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

st: Re: estimation results and matrix


From   "Michael Blasnik" <[email protected]>
To   <[email protected]>
Subject   st: Re: estimation results and matrix
Date   Tue, 12 Oct 2004 15:49:07 -0400

you've got the syntax wrong (note square brackets):

matrix answers[`i',1]=_b[x]


but why not use -statsby- ?

Michael Blasnik
[email protected]

----- Original Message ----- 
From: "Sibel Selcuk" <[email protected]>
To: <[email protected]>
Sent: Tuesday, October 12, 2004 3:36 PM
Subject: st: estimation results and matrix


> Hi,
> I'm trying to collect the coefficients of variable X in a matrix while
> doing the regression for different age groups. However, when I run the
> program, I get a message saying that "matrix operation not found".  Any
> suggestions would be appreciated. Thanks.
> 
> matrix answers=J(100,1,0)
> local i=23
> while `i'<70 {
> quietly regress y x if age==`i'
> matrix answers(`i',1,0)=_b(x)
> local i=`i'+1
> }
> 
> *
> *   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