Hi there!
I have household-level data with unique household_id. For each household, I have data for village_id and income, among other variables.
Is there any way I can create a new variable called village_income_mean by averaging the income amounts across a village given by village_id?
Thanks!
Related Posts with Averaging with a condition while generating a new variable
Labeling Dummy VariablesHi This may sound silly but I am having problems labeling the Stata output from 0 to YES and 1 to NO…
Dynamically row sum with conditionsDear Statalisters, I have information about the number of number of stocks bought by company and da…
Looping using list of var with similar prefixHi everyone! I'm getting stuck with something probably silly. I have a number of variables that sh…
Using the egen commandHello, Statalist members, I am a new Stata user. I would like to count the total number from the fi…
margins after mlogit not estimable - why?HI all, Ran the below multinomial logit model and some of the margins are not estimable. What are so…
Subscribe to:
Post Comments (Atom)
0 Response to Averaging with a condition while generating a new variable
Post a Comment