Hi,
I'm fairly new to state and I'm trying to pull something that is a bit complex for what I know for a project.
In this case, I have two relevant variables: income (int), and country (string).
I want to generate a new variable: the difference of the variable 'income', from the mean of all other observations with the same value for 'country'. In other words, difference in income from one's country's mean income.
I would like to post what I've tried so far, but in reality I'm sorta lost.
Thanks if you can help.
I'm fairly new to state and I'm trying to pull something that is a bit complex for what I know for a project.
In this case, I have two relevant variables: income (int), and country (string).
I want to generate a new variable: the difference of the variable 'income', from the mean of all other observations with the same value for 'country'. In other words, difference in income from one's country's mean income.
I would like to post what I've tried so far, but in reality I'm sorta lost.
Thanks if you can help.
Comment