Hi,
I have a data structure like this:
IO-IOarea-Year-index
1----4-------1997-0
2----4-------1998-2.2267373
3----5-------1998-0
4----5-------2000-0
I would create a mean of index variable for each IOarea group per year. So I used this code:
by IOarea Year, sort: egen index_byissue=mean(index)
However, now I would like to add a second step where I show the mean of the group minus that IO's score per year. So each IO get the score of index_byissue minus its own score each year. I aim to use other group members' average score each year as a new variable.
Thanks so much by now!
Related Posts with Mean of a group minus the observation's value in Panel data
Episode splittingHi, I am trying to split my time-varying education variable, didn't figure out something. In my data…
export the result of logistic in excelHi, I have 30 predictors and I would like to fit uni-variate logistic regression for each predictor…
myqreg vs qregI'm working with a code (from a published paper) and it defines the following program: Code: progr…
General regression helpHi, I am having some problems with the basics of regressions. I have panel data, similar to what is…
datatypes and Logistic regressionGeneral question Do I have a special data format when performing logistic regression? What I mean i…
Subscribe to:
Post Comments (Atom)
0 Response to Mean of a group minus the observation's value in Panel data
Post a Comment