Hello,
Suppose I have the following dataset. (apologies for the formatting, I was trying to make the columns clearly defined, and don't know any other way to do that here). There are multiple observations per person taken over different periods of time, and some people have been observed more times than others.
I would like to know how many people enrolled in a course post college. . If a person is listed as having enrolled post college, that takes precedence over any observation that says no post college. To account for multiple observations per person, I generated tag = tag(id1). My question is, would the command "tab tag postcollegeenrollment" say that two out of the three people here have enrolled in a post college course? Or would it incorrectly say that no one enrolled in a post college course because each of the rows where tag = 1 has the corresponding postcollegeenrollment value "No Post-college enrollment"? If the second case is true, what other stata commands can I use to answer my initial question? (Of course, my full dataset has 1000s of observations, so I can't just count like I did here).
major..................postcollegeenrollment...... ........id1........tag
French................No Post-college enrollment.....1...........1
French................No Post-college enrollment.....1...........0
French................Post-college enrolled............. 1.......... 0
French................Post-college enrolled.............. 1.......... 0
French................Post-college enrolled.............. 1.......... 0
French................Post-college enrolled.............. 1.......... 0
History................No Post-college enrollment..... 2.......... 1
History................No Post-college enrollment..... 2.......... 0
Neuroscience.....No Post-college enrollment .....3.......... 1
Neuroscience.....No Post-college enrollment .....3.......... 0
Neuroscience.....Post-college enrolled.............. 3.......... 0
Thank you for your help.
Suppose I have the following dataset. (apologies for the formatting, I was trying to make the columns clearly defined, and don't know any other way to do that here). There are multiple observations per person taken over different periods of time, and some people have been observed more times than others.
I would like to know how many people enrolled in a course post college. . If a person is listed as having enrolled post college, that takes precedence over any observation that says no post college. To account for multiple observations per person, I generated tag = tag(id1). My question is, would the command "tab tag postcollegeenrollment" say that two out of the three people here have enrolled in a post college course? Or would it incorrectly say that no one enrolled in a post college course because each of the rows where tag = 1 has the corresponding postcollegeenrollment value "No Post-college enrollment"? If the second case is true, what other stata commands can I use to answer my initial question? (Of course, my full dataset has 1000s of observations, so I can't just count like I did here).
major..................postcollegeenrollment...... ........id1........tag
French................No Post-college enrollment.....1...........1
French................No Post-college enrollment.....1...........0
French................Post-college enrolled............. 1.......... 0
French................Post-college enrolled.............. 1.......... 0
French................Post-college enrolled.............. 1.......... 0
French................Post-college enrolled.............. 1.......... 0
History................No Post-college enrollment..... 2.......... 1
History................No Post-college enrollment..... 2.......... 0
Neuroscience.....No Post-college enrollment .....3.......... 1
Neuroscience.....No Post-college enrollment .....3.......... 0
Neuroscience.....Post-college enrolled.............. 3.......... 0
Thank you for your help.
Comment