asp_a<-c(15,26,13,28,17,20,7,36,12,18)
asp_b<-c(13,20,10,21,17,22,5,30,7,11)
cor(asp_a,asp_b)
## [1] 0.9338095
mean(asp_a)
## [1] 19.2
mean(asp_b)
## [1] 15.6
\(H_a:\mu_1\neq\mu_2\)
The mean concentrations are not equal to each other.
t.test(asp_a, asp_b,
alternative = c("two.sided", "less", "greater"),
mu = 0, paired = TRUE, var.equal = FALSE,
conf.level = 0.95)
##
## Paired t-test
##
## data: asp_a and asp_b
## t = 3.6742, df = 9, p-value = 0.005121
## alternative hypothesis: true mean difference is not equal to 0
## 95 percent confidence interval:
## 1.383548 5.816452
## sample estimates:
## mean difference
## 3.6
The p-value is around 0.005, therefore, we reject the null hypothesis.
t.test(asp_a, asp_b,
alternative = c("two.sided"),
var.equal = FALSE)
##
## Welch Two Sample t-test
##
## data: asp_a and asp_b
## t = 0.9802, df = 17.811, p-value = 0.3401
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -4.12199 11.32199
## sample estimates:
## mean of x mean of y
## 19.2 15.6
The p-value is around 0.34, therefore, we reject the null hypothesis.
act_ex<-c(9.5,10,9.75,9.75,9,13)
no_ex<-c(11.5,12,13.25,11.5,13,9)
mean(act_ex)
## [1] 10.16667
mean(no_ex)
## [1] 11.70833
\(H_o:\mu_1= \mu_2\)
\(H_a:\mu_1\le \mu_2\)
qqnorm(act_ex,main="Normal Q-Q Plot Active Exercise")
qqline(act_ex)
qqnorm(no_ex,main="Normal Q-Q Plot No Exercise")
qqline(no_ex)
The QQ Plot follows the in an linear pattern, while the other plot doesn’t.
wilcox.test(act_ex, no_ex, alternative = "two.sided", paired = FALSE, exact = FALSE, correct = TRUE, conf.int = FALSE, conf.level = 0.95)
##
## Wilcoxon rank sum test with continuity correction
##
## data: act_ex and no_ex
## W = 9, p-value = 0.1705
## alternative hypothesis: true location shift is not equal to 0