Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: rowmean within a loop


From   "Carlo Lazzaro" <carlo.lazzaro@tiscalinet.it>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: rowmean within a loop
Date   Mon, 22 Jun 2009 12:44:54 +0200

Dear Statalisters,
after typing 

qui forval i =1/10000  {
qui g double s`i' = Surv_Pos_IFI[`i']*(1-Monthly_Pr_Death_AML_MDS_Prob) in 1
replace s`i' = s`i'[_n-1]*(1-Monthly_Pr_Death_AML_MDS_Prob) if s`i'==.
qui g double u`i' = s`i'*LYS
}

I would like to obtain a variable where I can store the rowmeans for all the
u`i'.

I tried unsuccessfully to use egen v`i'=rowmean(u`i'), but this way I
(obviously, I would suppose) get v`i' for each u`i', and this not help the
achievement of my research purpose.

Thanks a lot for your kindness and for your time.

Kind Regards,
Carlo


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



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index