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
Need for a permutation test ?Hi, STATA people, I have 12000 observation. I want to randomly assign a fake treatment value of 1 t…
Change of variable in one columnHi Stata users, I am trying to generate a variable to tell me when a change in values has occurred …
cond() functionHi all! I have the following dilemma. I would like to create variables such that: if a local takes…
A loop to predict a log-modelFor the model, Y= Yt-1+X1t+X2t+X3t+e I want to create a loop to predict future values such that the …
Simple by() and 'if' questionI'm working with some historical data on NFL players. I want to create a dummy variable indicating w…
Subscribe to:
Post Comments (Atom)
0 Response to Expanding an observation to various rows
Post a Comment