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
Specify overall column and heterogenity statistic on forest plot in Stata 17Hello! I'm working in Stata 17 with the following meta set, declared as follows: meta set logrr lo…
Synthetic Control, Synth commandHello, I am currently working on applying the Synthetic control method on Stata. To resume my work, …
Explanation of tabstat commandHello, I am a little confused when running the "tabstat" command. For example, I entered the comman…
Spearman's rank correlation resultDear All, Can someone help me out, there's no result detail after i run my command. the code: by ag…
Yearly Sale Changes (in percentage)hello statalist, I hope everyone is fine I've following panel data of customers. I wanna know how …
Subscribe to:
Post Comments (Atom)
0 Response to comparing specific levels in a categorical variable
Post a Comment