Hello,
Sorry if this is a simple question, but I am trying to generate a variable that is an average of the rows above it (a column mean). However, its not clear to me how to do this.
Using collapse will not work because I have different groups in the first column and because stata requires a "by" variable this would not work.
There doesn't appear to be an equivalent command for column to creating means as there is for rows (i.e. rowmean)
Has anyone found a way to generate a variable like this?
thanks!
Donovan
Sorry if this is a simple question, but I am trying to generate a variable that is an average of the rows above it (a column mean). However, its not clear to me how to do this.
Using collapse will not work because I have different groups in the first column and because stata requires a "by" variable this would not work.
There doesn't appear to be an equivalent command for column to creating means as there is for rows (i.e. rowmean)
Has anyone found a way to generate a variable like this?
thanks!
Donovan
Comment