Creating new variables based on patterns across other variables

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

JKOBRIN
Posts: 1
Joined: Wed Jun 21, 2017 12:45 pm

Creating new variables based on patterns across other variables

Postby JKOBRIN » Wed Jun 21, 2017 5:39 pm

I have a series of variables indicating whether a student was “still enrolled”, “not enrolled” or graduated in each semester, represented by a series of variables called Fall99 to Spring02. I’d like to compute several variables:
1) A variable indicating if a student dropped out (e.g., case 4 who was Enrolled, then Not Enrolled and did not enroll again)
2) A variable indicating if a student “stopped out” (e.g., case 5 who was Enrolled, then Not Enrolled, then Enrolled again)
3) A variable indicating the number of times a student stopped out.
4) For cases that dropped out, a variable indicating the number of semesters a student was enrolled before leaving (e.g., case 4 = 2)
5) For students who stopped out, a variable indicating the number of semesters a student was not enrolled before coming back (e.g., case 5 = 1); if they stopped out more than once, take the average.

Help in creating the syntax to create these variables is greatly appreciated!
Thank you,
Jennifer

Case Fall99 Spring00 Fall00 Spring01 Fall01 Spring02
1 Not enrolled Not enrolled Not enrolled Not enrolled Not enrolled Not enrolled
2 Enrolled Enrolled Enrolled Enrolled Enrolled Enrolled
3 Not enrolled Not enrolled Enrolled Enrolled Enrolled Graduated
4 Enrolled Enrolled Not enrolled Not enrolled Not enrolled Not enrolled
5 Enrolled Enrolled Enrolled Enrolled Not enrolled Enrolled
6 Enrolled Enrolled Enrolled Enrolled Graduated Graduated

Who is online

Users browsing this forum: No registered users and 1 guest

cron