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?
Creating a change variable, panel dataHi everyone, I have a Panel Data Set and want to create a variable which shows me the change of the…
Help with new variable generationHi, I`m trying to generate a new variable = different expressions by sex, but only if sex==0 the exp…
help with foreach using 2 variable lists to generate a new variableHello all. I am trying to use foreach to generate a new variable based on multiple variables from 2 …
Why different results for tests for serial correlation / autocorrelation in panel data (abar, actest, xtserial)?I would like to test my panel data for serial correlation. The panel data is unbalanced and has gaps…
Merge Panel Data set by IdsI have a panel data set (Master) with id, name, month, and year. I have another data set (Data set …
Subscribe to:
Post Comments (Atom)
0 Response to How to Distinctively Remove the Observations with Specific Missing Value Patterns in Stata?
Post a Comment