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
Decipher a user-written "bogus" programHi everyone From this discussion, Daniel Klein wrote a program called "bogus" that is able to corre…
Need help modelling dataI need helping modelling this data over stata. Im finding it difficult creating dummy for those that…
Percentile errorhi. I am working with register data and I can't extract them to show you how it looks like. I try to…
Changing numeric label values while keeping existing label valuesDear Statalists, I have a question regarding modifying label values. I have a string variable with …
Formative and reflective indicators SEMHi, I am trying to estimate a latent variable (human capital - HC) which has formative indicators e…
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