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

st: rowmean within a loop

From   "Carlo Lazzaro" <>
To   <>
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

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,

*   For searches and help try:

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