Dear Statalist users,
forvalues i = 1(1)3641 {
mat c`i'= b*Xi`i''
capture drop c
quietly gen c= el(c`i',1,1)
quietly sum c
quietly replace result=r(mean) in `i'
drop c
}
For a large set of individuals (here 3641), I have to multiply two vectors, with b and Xi`I' being a 1x10 vector. As a result I receive for each individual a 1x1 matrix, just containing 1 value.
I now would like to produce one single scalar variable, that for each `I' row contains the number of c`I'.
I have found a way how to do that, given above. But my simple solution is incredibly slow.
Could you help?
Many thanks
Sylke V. Schnepf
Ps. Many thanks for the help on the program for programming a weighted regression, very helpful.
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/