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?
Mediation analysis with Sem and OlsHi all, I am currently working on mediation analysis and effects decomposition. Since one of my main…
Analysing multiple response variablesI want to analyse the relationship (using Chi-square test) between (AgeNEW, Gender) Vs (Q42-producti…
Winsor2 only for one yearHello everybody, I have a dataset with many years and want to use winsor2 only for the year 2011 (I…
import many files and generate an `id' variable as the file name.Dear All, Suppose that I have the following 3 files (in fact, about 4,000 similar files). The file n…
GSEM errorHello, Am trying to use gsem probit and finf the following errors: HTML Code: _gsem_d2Sigma_d…
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