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 Aggregate Repeating Dates into new tableI can't remember how to effectively reshape repeating dates in a time series into a new table. Belo…
Granger-causality testHello Is it possible to perform a Granger-causality test including an instrumental variable using pa…
Comparing regression coefficients across groups in presence of fixed effects with suestHi all, I am trying to run regressions with a building by month panel. Each building have a unique b…
Controlling the space occupied by a axis labelsHi all, I am trying to create a panel graph of two histograms and a scatter using graph combine. T…
Generate dates that correspond to the 1st Tuesday of each monthHi, The Australian RBA meets the first Tuesday of each month 11 times a year (every months but Janu…
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