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
metan on Stata 16 column nameHi everyone, I've been recently using "metan" on Stata 16 to update my previous meta-analysis resul…
Storing regression results in a Temp Table in order to afterwards run a two sample t testHello! I am having a problem trying to perform a two sample t test on the outcome of two regression…
Radf command does not run (error 3499)Hi all, I am trying to run a GSADF test through the radf command in Stata 16. I keep getting this e…
Get percents using tabstatHi all I am trying to get percents from a tabstat table. I know that using tabulate command is much…
stset issueHello guys i was preparing my data for survival analysis and encountered a problem. Below is a sampl…
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