My data (student course enrollment) is currently in long form, and I would ideally like to reshape it to be wide so each column represents binary enrollment in a course and there is only one row per student. This is data from one semester to begin (course_sect is numeric; those are labels):
Code:
pseudoid course_sect
1012 JMC-100
1012 SOC-100
1012 FSID-18
1012 GEOG-10
1022 STAT-24
1022 SOC-100
1022 CJUS-10
1022 GEOG-10
1022 CHEM-16
1022 CHEM-16
1038 ECON-27
1038 ACCT-25
1038 ECON-11
1038 HIST-25
1038 MGT-301
1040 ART-100
1040 CHEM-14
1040 PE-360-
1040 PE-174A
1040 PE-250-
I'm guessing there's a relatively simple way to deal with this, but I can't conceptualize it. I don't want courses grouped, so I can't figure out how to use reshape correctly. I've tried using
Code:
tab course_sect, gen(course_)
but then the data is still long (with multiple observations per pseudoid). I could then do a "column max" by pseudoid "group," but that seems like a very roundabout way.
I appreciate your help!
0 Response to Student Course Enrollment Data (Long to Wide): Transpose, Reshape, Collapse?
Post a Comment