Hey,
I have variables (wk1, wk2 etc.) which contain the number of trainings weekly. 110 weeks altogether
I tried to creat 4weeks moving averages, but it doesn't want to work:
forvalues i=1/107 {
egen mmean`i'=rowmean(wk`i' wk`i+1' wk`i+2' wk`i+3')
}
It always gives me the value of wk`i', and not the average of the 4 consequtive years.
Do you have any idea?
Thank you
I have variables (wk1, wk2 etc.) which contain the number of trainings weekly. 110 weeks altogether
I tried to creat 4weeks moving averages, but it doesn't want to work:
forvalues i=1/107 {
egen mmean`i'=rowmean(wk`i' wk`i+1' wk`i+2' wk`i+3')
}
It always gives me the value of wk`i', and not the average of the 4 consequtive years.
Do you have any idea?
Thank you
Comment