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
Using stir to analyse IRR for cancer recurrence in two groups, p significant but CI range below 1, any thoughts?Dear all, I have a set of data with approximately 100 patiens treated for cancer in two groups in r…
How to add value label to default missing values?Hi there, Sorry for a really beginner question. I am trying to add value labels to organise my data…
Creating a subsample with missing value restrictionsDear all From the entire sample list ,I would like to create a sub-sample based on certain condtions…
-meprobit- vs -probit- with clustered standard errorsHi all, So I have a multi-level data, with individuals from different countries, over the period of …
Using a cross sectional analysis to support the results of a panel analysisHi all, I have a 3 wave panel of children's height and weight and whether either of their parents e…
Subscribe to:
Post Comments (Atom)
0 Response to Mean of a group minus the observation's value in Panel data
Post a Comment