Statalist


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

Re: st: which variables are in the model?


From   Austin Nichols <[email protected]>
To   [email protected]
Subject   Re: st: which variables are in the model?
Date   Thu, 5 Feb 2009 14:16:39 -0500

Alan <[email protected]>:
It might help if you clarified where you are storing the results, for
what purpose--I assumed you were doing some low-level parsing of
results given that you are rolling your own with -bsample-.  Might the
below code help?

cap prog drop putebin
prog putebin
 syntax anything
 conf matrix `anything'
 loc vlist: colnames `anything'
 tempname b new
 mat `b'=e(b)
 foreach c of local vlist {
  cap mat `new'=nullmat(`new'),`b'[1,"`c'"]
  if _rc mat `new'=nullmat(`new'),.
  }
 mat `anything'=`new'
 mat colname `anything'=`vlist'
 end
sysuse auto, clear
gen m2=mpg
replace m2=uniform() in 2/5
qui xtreg price mpg m2, i(rep78)
mat b=e(b)
mat li b
set seed 1
bsample
qui xtreg price mpg m2, i(rep78)
mat li e(b)
putebin b
mat li b
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index