Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: saving regression results in matrix


From   Helge Liebert <[email protected]>
To   [email protected]
Subject   st: saving regression results in matrix
Date   Tue, 13 Jul 2010 18:11:13 +0200

dear statalist,

im a student who started using stata a few months ago, so im far from
being fluent yet.

i have compiled a dataset and done various regressions, and i know the
specifications i want to present later.

as a further robustness check, i would like to run regressions using
all combinations of some additional variables added to a baseline
specification.

i would like to save all results from these regressions so that i can
later look at histograms of coefficients, standard errors, pvalues and
the number of regressions the variables were included in. i have tried
to to this with macros, but then thought it might be best to save the
coefficients matrix, compute the standard errors and pvalues and save
these as a matrix as well. then, for each additional regression a row/
column would be added to the matrix. please let me know if this is way
off and there is a better way to do it.

so far i have used selectvars or tuples to create the combinations of
variables and loop over the regression (again, there is probably a
nicer way.)

selectvars x y z
foreach addvar in `r(varlist)' {
xtnbreg some baseline vars `addvar' year_*, fe irr
mat b=e(b)
mat se= vecdiag(cholesky(diag(vecdiag(e(V)))))
mat pval = 2*(1-normprob(abs(coef/se))) /// how can i make this work?

then add additional values after each regression
}


i apologize if i'm completely mistaken at how to do this in a sensible
way, im just starting out. i thought this might be a nice
demonstration of robustness for my thesis.


thanks alot,


Helge
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index