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

st: RE: re statsby: collecting betas


From   "Wallace, John" <[email protected]>
To   <[email protected]>
Subject   st: RE: re statsby: collecting betas
Date   Mon, 13 Dec 2004 12:33:58 -0800

The difference was the -if- statement.  When I revised the code to...

----begin code----
levels unit, local(units)
qui foreach u of local units { 
	anova logcpint /*nested & interacting terms*/ if unit==`u' 
,continuous(benchdwellmin) partial regress anova
	matrix results = nullmat(results) \ e(b)
}
mat list results
---end code---

...I got a new problem, that Nick alluded to in his last reply: error
505 conformibility error.  For some reason it looks like the anova for
the unit following the first one ends up with a different size matrix
for e(b).  When I set trace on the first unit is processed correctly,
then at the point in the next pass through where the new e(b) vectors
are joined the conformibility error occurs.
Stepping manually through the code I get
Unit 1020 e(b)[1,96]
Unit 1021 e(b)[1,104]
Unit 1021 e(b)[1,104]
...
Unit 1045 e(b){1,24]

I suspect if I do some upstream filtering of my data, so only those
units with identical terms for the independent variables in the anova
are processed I'll be successful.  Thanks for your help!

-JW


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Kit Baum
Sent: Monday, December 13, 2004 12:01 PM
To: [email protected]
Subject: st: re statsby: collecting betas

webuse grunfeld,clear
forv i=1/10 {
	qui reg invest mvalue kstock if company==`i'
	mat results = nullmat(results) \ e(b)
	}
mat list results

seems to work fine in assembling these results from each firm.

Kit Baum, Boston College Economics
http://ideas.repec.org/e/pba1.html

*
*   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/

*
*   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