str(d1)
## 'data.frame': 54 obs. of 4 variables:
## $ subject : int 1 2 3 4 5 6 7 8 9 10 ...
## $ sex : Factor w/ 2 levels "female","male": 2 2 2 2 2 2 2 2 2 2 ...
## $ group : Factor w/ 2 levels "con","sevo2": 1 1 1 1 1 1 1 1 1 1 ...
## $ mEPSC_ampl: num 17.1 19.2 26.5 21.4 22.3 ...
md1=aov(d1[,4]~group*sex, data=d1)
summary(md1)
## Df Sum Sq Mean Sq F value Pr(>F)
## group 1 48.7 48.7 1.671 0.202118
## sex 1 498.1 498.1 17.084 0.000136 ***
## group:sex 1 1.9 1.9 0.065 0.799187
## Residuals 50 1457.7 29.2
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
interction()
## Accoring to the results,the p value of interaction is 0.799
## ,there is no statistically significant interaction between group and sex.
par(mfrow=c(2,2))
plot(md1)
SWT
##
## Shapiro-Wilk normality test
##
## data: residuals(md1)
## W = 0.97189, p-value = 0.2331
SWT_result()
## Accoring to the results, the p value of Shapiro-Wilk test is
## p = 0.233
## which is greater than 0.05, so normality assumption can be accepted
LT
LT_result()
## The p-value of Levene test is
## p = 0.291
## which is greater than 0.05, so equal variances can be assumed.
We use nested model for post hoc test(to compare group within each sex). There are only one test, so we do not use p-value adjustment.
p
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 19.413230 1.443047 13.452947 3.060434e-18
## sexmale 5.711841 2.040776 2.798857 7.266738e-03
## sexfemale:groupsevo2 1.524599 2.079651 0.733103 4.669189e-01
## sexmale:groupsevo2 2.276802 2.079651 1.094800 2.788502e-01
nm_result1()
## 1.The result of nested model in female
## p = 0.467
## statistically significant difference exist between groups
nm_result2()
## 2.The result of nested model in male
## p = 0.279
## statistically significant difference exist between groups