Hi Statalist experts,
I would need a little help. I'm working with a dataset containing the following 3 variables:
1) household identifier (idhh)
2) individual identifier (idpers)
3) demographic age (dag)
I would like to create a new variable (var1) who assigns value 1 to all the members of a household if there is AT LEAST an individual with dag<18 in that same household (same idhh), and zero otherwise.
How can I translate this command in Stata language?
Thanks in advance for your help!
Andrea
Related Posts with How to assign the same value to all members of a group if a condition on a certain variable occures AT LEAST once in the same group
dyndoc with table, statistic() errorHello Stata Corp. While trying out the new collect and table commands in Stata 17 I discovered a bu…
Mean of frequency from tabHello, i'm using Stata 16. I am trying to calculate the mean of the frequency values (second column…
"Dummy Variable in Regression"Greetings Everyone! Hopefully, you will be fine, I want to check the impact of Family CEOs on firm …
Random sample panel datahello guys! My data consist of unbalanced Panel data with the identifier gvkey_num fyear, fyear con…
sum of the coming 5 years of a variableDear Statalist, I am trying to generate a variable, that is equal to the sum of the coming 5 years …
Subscribe to:
Post Comments (Atom)
0 Response to How to assign the same value to all members of a group if a condition on a certain variable occures AT LEAST once in the same group
Post a Comment