Stata Users,
I'm new to the program and I am trying to figure out how to conduct a t-test between my continuous dependent variable (mntlhlth) and my independent categorical variable (class) that shows the independent variable groups in the t-test. The dataset for class is which social class people identify themselves as with responses 1-4 (1=Lower Class, 2 = Working Class, 3 = Middle Class, and 4 = Upper Class)
I created dummy variables for the different social classes using gen lowerclass = 1 if class == 1 but not sure how to proceed to conduct a t-test after this.
I have tried ttest mntlhlth, by (lowerclass) and it says "1 group found, 2 required"
How do I go about creating a t-test that shows all 4 of the social classes?
Thank you in advance.
I'm new to the program and I am trying to figure out how to conduct a t-test between my continuous dependent variable (mntlhlth) and my independent categorical variable (class) that shows the independent variable groups in the t-test. The dataset for class is which social class people identify themselves as with responses 1-4 (1=Lower Class, 2 = Working Class, 3 = Middle Class, and 4 = Upper Class)
I created dummy variables for the different social classes using gen lowerclass = 1 if class == 1 but not sure how to proceed to conduct a t-test after this.
I have tried ttest mntlhlth, by (lowerclass) and it says "1 group found, 2 required"
How do I go about creating a t-test that shows all 4 of the social classes?
Thank you in advance.
Comment