Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Statsby - collecting betas


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Statsby - collecting betas
Date   Fri, 10 Dec 2004 20:03:09 -0000

A wild guess is that you can't do what you 
want this way. -anova- basically does 
all sorts of idiosyncratic things, and 
the estimates it leaves behind can't 
be related that easily to predictors. 
The more you think about interaction
terms etc., the less surprising that is. 

I think you need to do this directly. 
Loop over your -by()- variable and pick up 
a vector each time, adding it to a matrix
born null. 

Alternatively, a couple of -anova- extras
are documented via -whelp undocumented-. 

Nick 
[email protected] 

Wallace, John

> I have a statsby regression that I'm performing over a list 
> of 100 cases ("Units").  I'd like to collect the regression 
> coefficients from the various terms to analyze, so I'm using 
> the following command:
> 
> .statsby "anova logcpint benchdwellmin hyb benchdwellmin*nMES 
> nMES /nMES|die / nMES|die|atom / ,continuous(benchdwellmin) 
> partial regress anova" _b, by(unit) saving(betas.dta)
> 
> The problem is, when I run this I get an error:
> regressor c1 not found
> error in statistic: _b[c1]
> r(111);
> 
> This appears to happen immediately following the first Unit 
> analysis.  The problem is, when I have a look at the 
> coefficient matrix directly, there appears to be no problem:
> . matrix list e(b)
>             c1          c2          c3          c4          
> c5          c6          c7 ...        
> r1   7.8317621  -.00012466   .16011793           0  
> -.01768075           0  -.00007796           
> 
> _b[c1] is clearly defined, but statsby seems to have trouble 
> snagging it.  Am I interpreting the situation correctly?  Is 
> there a problem with the statsby statement?
> 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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