Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: AW: saving regression results in matrix

From   "Martin Weiss" <>
To   <>
Subject   st: AW: saving regression results in matrix
Date   Tue, 13 Jul 2010 18:54:34 +0200


Also look at Roger`s 

ssc d parmest

and Maarten`s


-----Ursprüngliche Nachricht-----
[] Im Auftrag von Helge Liebert
Gesendet: Dienstag, 13. Juli 2010 18:11
Betreff: st: saving regression results in matrix

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

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,

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index