Hello!
I am having an issue with figuring out how to look at the differences between two groups in my sample. I am using a ttest to figure out the difference between the means of two groups on my exposure variable with no problem,
Syntax:
ttest exposure, by (group)
However, I would also like to look at the differences between the individual scores for the exposure variable for my two groups (range 1-6). For example, i have different numbers in each group of people who score 2 and i would like to see if the difference is significant between the groups.
I tried treating the exposure as a discrete variable with the i. command which didn't work as the ttest needs to have a continuous variable,
Syntax:
ttest i.exposure, by (group)
I wondered if anyone had any advice on how i might do this?
Related Posts with comparing specific levels in a categorical variable
Planting multiple regressionHey, I hope you all safe and well. I'm a new to STATA and doing multiple regression modeling using x…
Generate a new variable as the mean of individuals over timeI have the following data set, a panel dataset, (it is an example of what I have, the data set is mu…
Generating four new variables out of one variable in a panel datasetHello, I'm trying to create four new variables in the following dataset: Code: input long pidp fl…
Marginal Effect of an Interaction Term after Logit (i.dummy#c.continous)Dear All, Here is my data. I am running a logit model and tried to get marginal effects. Here is m…
Planting multiple regressionHey, I hope you all safe and well. I'm a new to STATA and doing multiple regression modeling using x…
Subscribe to:
Post Comments (Atom)
0 Response to comparing specific levels in a categorical variable
Post a Comment