Hello Everyone,
Again a very basic question.
dataex:
v1 v2 v3
1 12 1
1 13 2
1 15 3
2 13 4
2 14 5
2 16 6
2 17 21
2 19 22
3 12 23
3 13 24
3 17 25
1 12
1 15
2 13
2 17
2 19
3 12
3 13
3 17
In above data example, how can I replace missing values of v3 based on values which are not missing. For example, missing value of v3 where v1=1 and v2=12 should be replaced with 1 based on first observation (where v1=1, v2=12 and v3=1 is given). I want to replace all missing values in one go.
Best
Amit
Related Posts with Replace missing values of a variable based on another previous values
Break in consecutive values to identify groupsSuppose I have a dataset like this: clear set obs 20 gen x = 1 gen id = 1 in 1/10 replace id = …
Multilevel regresion code doubtHi all, I have date of 100 employees per company, for several companies. I would like to perform a …
Find attrition at personal levelDear Stata users, I am using an unbalanced panel dataset. Here is an example of my dataset. hhid …
Meta Command for prevalencesI'm trying to run a meta-analysis using the metan command for a rate of the progression outcome vari…
Tabout and Fre suddenly not working?For some reason when I export frequency tables to excel and/or word (as .csv or .rtf files), they ar…
Subscribe to:
Post Comments (Atom)
0 Response to Replace missing values of a variable based on another previous values
Post a Comment