Hello,
I am working with a dataset that has households' IDs matched with individuals' IDs, so that each household has multiple individuals. In this dataset I have a variable related to the education of the mother that has a value for only one individual in the household while the rest of the individuals in the household has missing values for this variable. Accordingly I need a command that duplicates the existing value for all individuals in the same household. Kindly find below an example of the data and what I need to excute:
hhid indid mothedu
1 11 .
1 12 .
1 13 Secondary
2 21 .
2 22 Primary
3 31 .
3 32 .
3 33 University
What I need to do:
hhid indid mothedu
1 11 Secondary
1 12 Secondary.
1 13 Secondary
2 21 Primary
2 22 Primary
3 31 University
3 32 University
3 33 University
I hope I was clear enough in explaining the issue and thank you in advance.
Noha
Related Posts with I want to duplicate values of a variable for the same identifier
Transformation of variablesDear Stata list community, I am having trouble deciding whether to log my variables or not. If propo…
Correcting standard errors for a fixed effects Poisson modelHi all, I'm looking at the effect of fire occurrence on the number of visits to National Forests an…
marginal effects after STINTREGHi, I am using STINTREG to analyze interval data and as expected, the output is hazard ratios. I wa…
Error using "mixlogit" on StataSE 15: "__00000P not found"Hello, I am attempting to analyze data from a discrete choice experiment using the "mixlogit" packag…
Tabplot: how to change the position of the showval for a particular barHi List, I used tabplot to draw nine subplots. My codes are as below: Code: tabplot Wp [iw=iimpa…
Subscribe to:
Post Comments (Atom)
0 Response to I want to duplicate values of a variable for the same identifier
Post a Comment