Ttest with more than 2 group variable

Ttest with more than 2 group variable

by Manasi Deshpandey -
Number of replies: 2

This is in reference to my final project.

Just as in assignment 4, I tried to recode a variable in 3groups with recode command. After that I am trying to do a ttest with the new variable and another continuous variable but I am getting error "more than 2groups found"

"ttest bpsystol, by(diabetes_cat)"

I could run the graph bar with the same variables.

Can't we run a ttest with categorical variable with 3 or more groups?

In reply to Manasi Deshpandey

Re: Ttest with more than 2 group variable

by Atul Kumar -

t test is used to compare the mean value of a continuous variable in one group to that of another. So one variable needs to be continuous and the other dichotomous.  So you can't have your other variable into 3 categories..

In reply to Atul Kumar

Re: Ttest with more than 2 group variable

by Manuel Armas-Phan -

You need to use ANOVA since you are comparing more than two groups