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
Splitting a dataset into multiple datasetsHey all, Newish to STATA - longtime SAS user - sorry for the basic question. I have a dataset of ca…
Listing out the frequency distributions for multiple variablesHello! Quick question - I have data from a survey where participants can select multiple options fo…
Export labels from alpha output to ExcelI am estimating the alpha of several variables. I have specified asis, item, and label. I need to be…
Problems with FE in capital structure studyHello all. For my thesis I'm researching the capital structure in the UK and France. More specifical…
Help creating an index variableHi all. I have a panel dataset from Brazilian states with information on the number of radio station…
Subscribe to:
Post Comments (Atom)
0 Response to comparing specific levels in a categorical variable
Post a Comment