library(readxl)
df = read_excel("D:/R/Lec5/Лекция5R.xlsx", sheet = "аденоиды_Девочки")
df_dmg1=subset(df, X1or2sinusdmg == 1)
df_dmg2=subset(df, X1or2sinusdmg == 2)
#Task 1
a=df_dmg1$Lymph
b=df_dmg2$Lymph
shapiro.test(a)
##
## Shapiro-Wilk normality test
##
## data: a
## W = 0.92502, p-value = 0.1586
shapiro.test(b)
##
## Shapiro-Wilk normality test
##
## data: b
## W = 0.99134, p-value = 0.8816
t.test(a, b, alternative = 'two.sided')
##
## Welch Two Sample t-test
##
## data: a and b
## t = 0.073744, df = 23.457, p-value = 0.9418
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -5.542873 5.953129
## sample estimates:
## mean of x mean of y
## 29.16667 28.96154
#Task 2
c=df_dmg1$StickNuclear
d=df_dmg2$StickNuclear
shapiro.test(c)
##
## Shapiro-Wilk normality test
##
## data: c
## W = 0.44705, p-value = 2.875e-07
shapiro.test(d)
##
## Shapiro-Wilk normality test
##
## data: d
## W = 0.71246, p-value = 4.581e-11
wilcox.test(c, d, paired=FALSE, alternative = 'two.sided')
##
## Wilcoxon rank sum test with continuity correction
##
## data: c and d
## W = 682, p-value = 0.8301
## alternative hypothesis: true location shift is not equal to 0
#Task 3
e=df$ESRbefore
f=df$ESRafter
shapiro.test(e)
##
## Shapiro-Wilk normality test
##
## data: e
## W = 0.79256, p-value = 2.611e-10
shapiro.test(f)
##
## Shapiro-Wilk normality test
##
## data: f
## W = 0.93132, p-value = 8.31e-05
wilcox.test(e, f, paired=TRUE, alternative = 'two.sided')
##
## Wilcoxon signed rank test with continuity correction
##
## data: e and f
## V = 4029.5, p-value = 1.806e-13
## alternative hypothesis: true location shift is not equal to 0