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
How to calculate the sample size for three groups (or >2 groups) by log-rank test in StataWe plan to conduct a study for comparing the survival rate between three different types of surgery …
Generate Event WindowHello, I would like to perform an event study in Stata. Unfortunately, I cannot apply this https://…
Explaining frailty modelsHi all, I am currently researching on waiting time of passengers (the time passengers stay at the st…
Dataset FormatHey everyone! I was wondering if anyone could shed light on the the ".data" file format? I'm trying…
Initial condition y_i,0 in a dynamic model with individual specific effects (following Chamberlain's approach)Dear all, I was wondering how the initial observation y_i,0 should look like in the following AR(1)…
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