Quantcast

matrix operators that return matrices not allowed in this context r(509);

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

matrix operators that return matrices not allowed in this context r(509);

Rijkmans
This post has NOT been accepted by the mailing list yet.
Hi,

I constantly struggle how to cope with the error message matrix operators that return matrices not allowed in this context r(509)
I have found some topic how to cope with this problem but actually I'm not that advanced to fully grasp how my code should look like. I try to get the beta for every mutual fund (CRSP_Fundno) in my dataset (number 9900) once for all of the observations which belong to that specific mutual fund (so 9900 beta's).
Can anyone adjust the stated code so that it does work and not give the error matrix operators that return matrices not allowed in this context r(509)?

Thanks in advance!


xtset CRSP_Fundno Date

gen beta=.

 
levelsof crsp_fundno, local(levels)

foreach x of local levels {

capture reg FLOW  AGGLIQ if crsp_fundno == `x'

                if !_rc {

               

                replace beta=e(b) if crsp_fundno == `x'

               

                }

               

}
Loading...