Hello,
I am trying to create a variable (contenroll) that denotes whether a student was continuously enrolled during the time they took courses. To do this, I need Stata (SE 16.1) to place an 8 in my new variable if there were any missing values between the time the student started and stopped taking courses, and 1 if there are no missing values during the time the student was enrolled.
Example syntax:
replace contenroll = 8 if startmath == 200620 & stopmath == 200640 & trm_cde20062 != (30-40)
replace contenroll = 1 if startmath == 200630 & stopmath == 200730 & trm_cde20061-trm_cde20071 != .
The value of startmath and stopmath reflect the year and the term [yyyytt] of the enrollment. trm_cde variables indicate how many courses a student took in a given year; so trm_cde20061 contains the values of the first course that students enrolled in 2006 took. If they did not take a course in 2006, they are not included in this variable. If they took a second course, they will also have values in the variable trm_cde20062.
The above syntax is not bringing in observations to my new variable (0 changes made). Are there any recommendations of how to specify "replace value with 8 if there are any missing values in the terms between when a student was enrolled" and "replace value with 1 if there are no missing values in the terms between when a student was enrolled"?
Thank you!
Kayci
I am trying to create a variable (contenroll) that denotes whether a student was continuously enrolled during the time they took courses. To do this, I need Stata (SE 16.1) to place an 8 in my new variable if there were any missing values between the time the student started and stopped taking courses, and 1 if there are no missing values during the time the student was enrolled.
Example syntax:
replace contenroll = 8 if startmath == 200620 & stopmath == 200640 & trm_cde20062 != (30-40)
replace contenroll = 1 if startmath == 200630 & stopmath == 200730 & trm_cde20061-trm_cde20071 != .
The value of startmath and stopmath reflect the year and the term [yyyytt] of the enrollment. trm_cde variables indicate how many courses a student took in a given year; so trm_cde20061 contains the values of the first course that students enrolled in 2006 took. If they did not take a course in 2006, they are not included in this variable. If they took a second course, they will also have values in the variable trm_cde20062.
The above syntax is not bringing in observations to my new variable (0 changes made). Are there any recommendations of how to specify "replace value with 8 if there are any missing values in the terms between when a student was enrolled" and "replace value with 1 if there are no missing values in the terms between when a student was enrolled"?
Thank you!
Kayci
Comment