Dear all,
I am a bit stuck. I have household and personal id date for 8 rounds, however not each person is recorded in every round. I would like to recode a variable and replace its value with the value of the round before. My data looks the following:
ID HHID Round Y
1 1 1 1
2 1 1 0
3 1 1 2
3 1 2 .
How can I replace the missing value for Y for ID 3 in round 2 with the value of 2 for y from round 1 ?
Thank you very much!
Related Posts with Replace Values by previous values
Impulse response function after SVAR with exogenous variableHi, I'm trying to run the SVAR model with exogenous variables. A Y(t) = α+βy Y(t-1) + (d(t) +s(t))…
Graph bar by two groups in one chart (not combined)Hello Statalist, I would like to put two graphs in one chart. (1) bar graph (mean) of output by nat…
Merging datasetsHi Users, I just got access to a dataset (M) which I need to merge with another data based on id an…
explaining regression coefficients economic significanceHello I performed xtreg y x x , fe regression to test the relationship between profit and cash hold…
Working with dates and loopIs it possible to get a loop that works with every string variable which are in date format (CCYY-NN…
Subscribe to:
Post Comments (Atom)
0 Response to Replace Values by previous values
Post a Comment