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?
Two-way graph of longitudinal dataI have the following data below with pre-treatment data (denoted with the negative times) and post-t…
Count number of distinct cases by groupHi Stata Users, I am using Stata version 15 to calculate the number of distinct cases (firm) by a gr…
Missing variables in panel dataDear all, I am currently working on a panel data with a dataset from 1999, 2008 and 2017 In my lin…
Structural break for time series dataHello everyone, I have a question on structural break based on this. After having tested my time ser…
Can marginal effects at the mean be likely greater than one?Dear friends, I am confused if marginal effects at means be likely greater than one? Code: sysuse …
Subscribe to:
Post Comments (Atom)
0 Response to How to Distinctively Remove the Observations with Specific Missing Value Patterns in Stata?
Post a Comment