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
Sorting data in chronological orderHello, This post is similar to what I previously posted here: https://www.statalist.org/forums/for.…
Heckpoisson error - could not be evaluatedDear Stata Users, I am trying to fit a Poisson model correcting for Sample selection using the heck…
which is the correct way to do three-way interactionDear statalist, I have 3 variables, say x, y, and z. x and y are dummies, z is continuous. I want t…
How to write a text.file using loops?Hello everyone! I am trying to solve how to write a text.file using loops. I have hit an obstacle an…
Instrument exogeneity tests.Hello Statalists, I had a question relating both to STATA's instrumental variable post-estimation c…
Subscribe to:
Post Comments (Atom)
0 Response to comparing specific levels in a categorical variable
Post a Comment