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?
Predicted values and residuals in fracregKreutzer and Wood (https://www.tandfonline.com/doi/pdf/...B.82.6.357-362) showed how some undergradu…
Fixed Effects and the Effect of 0/1 dummyHello, I am trying to estimate the effect of Drug Law (coded 0/1) on recidivism rate using fixed ef…
Goodness of Fit test for xtgeeHi Stata experts, I am using -xtgee- to run models. I have a base model that only includes control …
Chi-Square Test for Comparing Subgroup CharacteristicsHi, I have a data set that I will be analyzing soon by a particular grouping with 2 levels. I first…
Creating a dummy variable in a large data set for interlocked companiesDear all I am asking for your help. I have tried to search on the previous posts but I failed to so…
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