728x90

blood_pressure.csv
0.00MB

data = read.csv("blood_pressure.csv", header = T)
head(data)
diff = data$bp_after - data$bp_before
round(mean(diff), 2) #(a) 답

#Simple T검정 결과
testResult2 = t.test(diff,
                    alternative = "greater", #귀무가설이 diff가 클 때 이므로 greater
                    conf.level = 0.95) #conf.level은 0.95이므로 유의수준이 0.05라면 작성안해도 됨.
testResult2
round(testResult2$statistic, 2)
round(testResult2$p.value, 4)

#F검정 결과
testResult3 = var.test(data$bp_before,data$bp_after)
testResult3
round(testResult3$statistic, 2)
round(testResult3$p.value, 4)
728x90