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?
"putexcel save" Error: SAVE: invalid cell nameHello! I am trying to output tables in excel with this code: putexcel set "${path_results}\\`sc'_$…
reshape of nested dataDear all, I tried to reshape the following nested data into long-year wide-series: Code: * Exampl…
Trouble adding statistic to esttab latex tableHello all. I am trying to add additional statistics to a latex table using the user-written command …
Stata Regression Help Using Fixed Effects and Cluster of Standard ErrorsHi all, I am looking to create a regression to determine the relationship between large increases i…
Question about svy: meanHello, this question is conceptual as much as anything else: when I run svy: mean var1 var2 var3, th…
Subscribe to:
Post Comments (Atom)
0 Response to How to Distinctively Remove the Observations with Specific Missing Value Patterns in Stata?
Post a Comment