Q1.

Aspirin_A<-c(15, 26, 13, 28, 17, 20, 7, 36, 12, 18)
Aspirin_B<-c(13, 20, 10, 21, 17, 22, 5, 30, 7, 11)
d<- Aspirin_A-Aspirin_B
qqnorm(d)
qqline(d)

The NPP indicates that normality is okay.

a)

Suppose \(d=A-B\)

Then \(H_0:\mu_d=0\), \(H_a:\mu_d\neq0\)

b)

t.test(Aspirin_A, Aspirin_B, paired = TRUE, alternative = "two.sided")
## 
##  Paired t-test
## 
## data:  Aspirin_A and Aspirin_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

Since p-Value=0.005121, less than α=0.05, therefore reject H0. There is sufficient evidence to say that the mean 1-hour urine concentrations of Aspirin A and Aspirin B are different.

c)

qqnorm(Aspirin_A)
qqline(Aspirin_A)

qqnorm(Aspirin_B)
qqline(Aspirin_B)

The NPPs indicate that normality is okay.

t.test(Aspirin_A, Aspirin_B, paired = FALSE, alternative = "two.sided")
## 
##  Welch Two Sample t-test
## 
## data:  Aspirin_A and Aspirin_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

Since p-Value=0.3401, greater than α=0.05, therefore fail to reject H0. There is not sufficient evidence to conclude that the mean 1-hour urine concentrations of Aspirin A and Aspirin B are different.

Q2.

Active_Exercise<-c(9.50, 10.00, 9.75, 9.75, 9.00, 13.00)
No_Exercise<-c(11.50, 12.00, 13.25, 11.50, 13.00, 9.00)

qqnorm(Active_Exercise)
qqline(Active_Exercise)

qqnorm(No_Exercise)
qqline(No_Exercise)

The NPPs show some departures from normality. The normality is not okay.

a)

\[H_0:\mu_{ActiveExercise}=\mu_{NoExercise}\] \[H_a:\mu_{ActiveExercise}<\mu_{NoExercise}\]

b)

Because the sample sizes are very small, and the normality is not good, a non-parametric method is more appropriate.

c)

wilcox.test(Active_Exercise, No_Exercise, alternative = "less")
## 
##  Wilcoxon rank sum exact test
## 
## data:  Active_Exercise and No_Exercise
## W = 9, p-value = 0.09524
## alternative hypothesis: true location shift is less than 0

Since p-Value=0.09524, greater than α=0.05, therefore fail to reject H0. There is not sufficient evidence to conclude that the mean time to walk is less for children who receive Active Exercise versus No Exercise.