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?
Collinearity error when including continuous variable in dummy regressionI am trying to run the following two regressions to compare the coefficients on the 'iso_str' dummie…
Cluster Randomized Controlled TrialI have a question about the Cluster Randomized Controlled Trial. Is it recommended to perform the sv…
Dipendent Double-Sorting 25 PortfoliosDear all, I am struggling to replicate the FF-25 portfolios with a variant, I should employ a depend…
traj command with hierarchical data structureI'm interested in using the user-written traj command (link below) to identify latent trajectories o…
getting a sample sizehi, I'm trying to get the sample size of black women from my data set. I created a black women(bw) …
Subscribe to:
Post Comments (Atom)
0 Response to How to Distinctively Remove the Observations with Specific Missing Value Patterns in Stata?
Post a Comment