Hi,
I have a data set of a household survey with hhcode denoting the household code and migrant denoting a dummy variable 1 if the household has received remittance and 0 otherwise
I want all the migrant values to be 1 for similar hhcode corresponding code.
hhcode migrant
1102100101 1
1102100101 0
1102100101 0
1102100102 0
1102100102 0
1102100102 0
1102100102 0
1102100102 0
1102100102 0
1102100103 1
1102100103 0
1102100103 0
1102100103 0
1102100103 0
1102100104 0
1102100104 0
I want the data to be this way:
hhcode migrant
1102100101 1
1102100101 1
1102100101 1
1102100102 0
1102100102 0
1102100102 0
1102100102 0
1102100102 0
1102100102 0
1102100103 1
1102100103 1
1102100103 1
1102100103 1
1102100103 1
1102100104 0
1102100104 0
Related Posts with Expanding an observation to various rows
how to count the number of variables after split?Dear All, How to generate a new variable that equals the number of variables generated after split?…
error in running mi impute chainedThank you very much in advance for reading this post, and for any help that you can extend. I am tr…
Multilevel modelling using “svy:melogit” with the ‘subpop’ option giving weird resultsI did my modelling using “svy:melogit” with the ‘subpop’ option in Stata 15.1 as follows after readi…
PPMLHDFE Gravity model for remittancesDear Tom Zylkin and Joao Santos Silva I hope you are doing well, I am using a gravity model in the …
Labels (Abc) from variable names (Abc_defghi)Hi all, I've seen a few posts asking questions about labelling variables by their respective names,…
Subscribe to:
Post Comments (Atom)
0 Response to Expanding an observation to various rows
Post a Comment