Hello, I have a small dataset as follows,
clear
input byte (id gr)
1 1
1 2
1 2
1 .
1 .
1 .
2 1
2 2
2 3
2 .
2 .
2 .
2 5
2 6
3 1
3 .
3 3
3 4
3 .
3 6
4 1
4 1
4 .
4 .
4 .
4 .
4 .
end
I want to delete the data with the continuous missing value from specific position to the last value in the variable of "gr" within id, like the data with id==4 and id==1.
As for the data with id==2 and id==3, although they have missing values, the missing values from specific position to the last value in the variable of "gr" within id is not continuous.
So, the data with id==2 and id==3 should be kept.
Can someone help me with Stata code?
Thank you!
Related Posts with How to Distinctively Remove the Observations with Specific Missing Value Patterns in Stata?
How do I make multiple variables in each dataset the same 'type' in order to append datasets and avoid losing data?I have a large number of datasets that contain 30+ of the same variables. I am attempting to append …
Forgot how I calculated a particular variableHi Stata community, Sorry to bother you all for such a silly query. I forgot how I calculated a pa…
How to save each Latent Class model (n=3) as predictor to run a regression model?Hi there, I am trying to look at the typologies of food outlets (within 1km from home) and eating be…
SURE modelEstimation via SURE model(Seemingly Unrelated Equation Models) Today, 00:43 dependent variabl…
Cointegration testHi i am doing panel analiz for banking sector i have data for 8 year for 231 banks the panel data d…
Subscribe to:
Post Comments (Atom)
0 Response to How to Distinctively Remove the Observations with Specific Missing Value Patterns in Stata?
Post a Comment