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/