Hello,
I have a small dataset as follows, id is student id, and gr represents grade. If a student failed grade, then the student will repeat grades and the new variable "GR" should be equal to 1, otherwise 0.
If the gr value is missing value, then "GR" is also equal to missing value.
clear
input byte (id gr)
1 1
1 2
1 2
1 3
1 4
1 4
1 4
1 4
1 5
1 6
2 1
2 2
2 3
2 4
2 4
2 5
2 5
2 6
3 1
3 .
3 3
3 4
3 .
3 6
4 1
4 1
4 2
4 3
4 4
4 5
4 6
end
I ever asked this question at https://www.statalist.org/forums/forum/general-stata-discussion/general/1654328-ask-for-help-to-create-multiple-sell-and-multiple-state-data-using-statat
However, I forgot the issue of missing value. So, today I asked here.
Can someone help me with the Stata code?
Thank you!
Related Posts with How to Correctly Create a Variable to Indicate if a student Failed Grade in Stata?
Estimates table - mlogitHi, I want to report only certain coefficients from multinomial logistic regression. I am using the…
Non Normal Panel DataHi, I am relatively new to econometrics. I want to know does panel data have to be Normal? My data o…
Non Normal Panel DataHi, I am relatively new to econometrics. I want to know does panel data have to be Normal? My data o…
Augmented Dickey Fuller - advice abount rejection and lagsHi all, I'm really rusty with econometrics. I'm using hourly data for a period of 5 years for electr…
foreachPlease help identify why this loop wont work on "`x'=="Z591". I get the message "type mismatch" befo…
Subscribe to:
Post Comments (Atom)
0 Response to How to Correctly Create a Variable to Indicate if a student Failed Grade in Stata?
Post a Comment