Hello everyone,
I hope you are doing fine. I am currently assessing an experiment. I had 90 subjects performing a task over 5 rounds. They were divided into three groups (between subjects), and next to rounds and scores I also had their gender (here coded Female). I want to look at the interaction between female and round, to see whether there are differences in round effects depending on gender. E.g. maybe there is a round (time) effect for male subjects, but not for female.
I found this code and adapted it to my needs, however, I am unsure about its interpretation.
Below you can find the code I used (I hope it is in the right format). You can also see the comments on the effects I made.
I have the following understanding of what I am doing:
- First, the anova is performed, which indicates significant interaction. Contrast shows this for the specific round.
- Through the contrast command afterwards I see the effect of time for each gender and if it is significant
- the margins in the next one is checking separatededly for both genders and all pairs
- the next part checks for the singular effect of the gender at each time
My questions are:
- Are my comments correct?
- Is my understanding correct?
- Am I missing anything?
I hope you are doing fine. I am currently assessing an experiment. I had 90 subjects performing a task over 5 rounds. They were divided into three groups (between subjects), and next to rounds and scores I also had their gender (here coded Female). I want to look at the interaction between female and round, to see whether there are differences in round effects depending on gender. E.g. maybe there is a round (time) effect for male subjects, but not for female.
I found this code and adapted it to my needs, however, I am unsure about its interpretation.
Below you can find the code I used (I hope it is in the right format). You can also see the comments on the effects I made.
I have the following understanding of what I am doing:
- First, the anova is performed, which indicates significant interaction. Contrast shows this for the specific round.
- Through the contrast command afterwards I see the effect of time for each gender and if it is significant
- the margins in the next one is checking separatededly for both genders and all pairs
- the next part checks for the singular effect of the gender at each time
My questions are:
- Are my comments correct?
- Is my understanding correct?
- Am I missing anything?
Code:
anova Score Female / ParticipantID|Female Round Female#Round, repeated(Round) ** -> interaction effect is significant (gender and round interact with each other) ** -> Round effect is significant (some tests) and indicates that there is a difference between the rounds contrast a.Round#Female ** -> Jointly, only effect from second to third round is significant ****** additional aspects contrast Round@Female, effect ** -> effects only for male: 3 to base, 4 to base, and 5 to base margins Round, at(Female=1) pwcompare(effects) noestimcheck ** -> no effects margins Round, at(Female=0) pwcompare(effects) noestimcheck ** -> effects: 3 to 1, 4 to 1, 5 to 1, 4 to 2, and 5 to 2, anova Score Female##Round contrast Round@Female, effect ** -> only significance in comparing 1 to 5 margins Female#Round marginsplot, x(Round)
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte(ParticipantID Group Round) double Score byte Female 1 1 1 -.7910944306858633 1 1 1 2 -1.0269490744398917 1 1 1 3 -.8738091030329711 1 1 1 4 -.5729675484954635 1 1 1 5 -.400363384534748 1 2 1 1 .5927726206979186 0 2 1 2 .8297738353289045 0 2 1 3 .5762526177174433 0 2 1 4 .6744897501960817 0 2 1 5 .2967378382598981 0 3 1 1 -.8495855373182969 1 3 1 2 -.8376590430971385 1 3 1 3 -.7910944306858633 1 3 1 4 -.6195477803879315 1 3 1 5 -.8180417759124541 1 4 1 1 -.4614936942181583 1 4 1 2 -1.2627844162947808 1 4 1 3 -1.6448536269514726 1 4 1 4 -1.763728040633686 1 4 1 5 -.8738091030329711 1 5 1 1 .7242880874234008 0 5 1 2 .2967378382598981 0 5 1 3 .48329133890772974 0 5 1 4 .8985565917048498 0 5 1 5 .9944578832097528 0 6 1 1 -1.8807936081512509 1 6 1 2 -1.8191477690437625 1 6 1 3 -1.8807936081512509 1 6 1 4 -2.0098747721953845 1 6 1 5 -2.0098747721953845 1 7 1 1 -.18486702761944254 1 7 1 2 -.4246235657803619 1 7 1 3 -.32891197566572217 1 7 1 4 -.08924287887565444 1 7 1 5 .0027851461281113033 1 8 1 1 1.4757910281791709 0 8 1 2 1.3271942183604362 0 8 1 3 1.2324587197131789 0 8 1 4 -.49900228007558534 0 8 1 5 -.6433454053929168 0 9 1 1 -1.1476547672158675 0 9 1 2 -1.3407550336902165 0 9 1 3 -.9990349151802846 0 9 1 4 -1.4757910281791702 0 9 1 5 -1.3829941271006387 0 10 1 1 1.0364333894937894 1 10 1 2 .33479759110257196 1 10 1 3 .08365173390712907 1 10 1 4 -.06968492031845566 1 10 1 5 .22183228666917584 1 11 1 1 -.5927726206979184 1 11 1 2 -.9853657550352516 1 11 1 3 .5084880591093566 1 11 1 4 .735192571938582 1 11 1 5 .1368983904280161 1 12 1 1 -.22754497664114945 1 12 1 2 -.06968492031845566 1 12 1 3 .061311526679252146 1 12 1 4 -.32891197566572217 1 12 1 5 .5084880591093566 1 13 1 1 .7098812513288475 0 13 1 2 .612812991016627 0 13 1 3 .11444014881194711 0 13 1 4 .8025718880593095 0 13 1 5 -.18486702761944254 0 14 1 1 -1.4925479547163985 1 14 1 2 1.5184980572589322 1 14 1 3 1.2627844162947803 1 14 1 4 1.1263911290388005 1 14 1 5 .35845879325119373 1 15 1 1 .5469043537825481 0 15 1 2 .5469043537825481 0 15 1 3 .3853204664075676 0 15 1 4 .8297738353289045 0 15 1 5 .6263107889358445 0 16 1 1 .6920771366140133 1 16 1 2 .2418596857990917 1 16 1 3 -.400363384534748 1 16 1 4 .1368983904280161 1 16 1 5 -.08924287887565444 1 17 1 1 -1.287908610584834 0 17 1 2 -1.0460118625082266 0 17 1 3 -.18486702761944254 0 17 1 4 -.06968492031845566 0 17 1 5 -.08924287887565444 0 18 1 1 -1.0954184989297098 0 18 1 2 -1.238432987203541 0 18 1 3 -1.1694503792916737 0 18 1 4 -.9718782705519045 0 18 1 5 -.9853657550352516 0 19 1 1 -.34956302147213447 1 19 1 2 -.4246235657803619 1 19 1 3 -.5308026326187639 1 19 1 4 -.31717461426306087 1 19 1 5 -.22754497664114945 1 20 1 1 -.49900228007558534 0 20 1 2 -.31717461426306087 0 20 1 3 -.37932781842312313 0 20 1 4 -.5308026326187639 0 20 1 5 .11444014881194711 0 end
Comment