1a) Ho: \(\mu_1 = \mu_2\) - Null Hypothesis

Ha: \(\mu_1 \neq \mu_2\) - Alternative Hypothesis

\(\sigma^2_1\) = 19.2, \(\sigma^2_2\) = 15.6, \(n_1\) = 10, \(n_2\) = 10

\(\mu_1\) is the mean of Aspirin 1

\(\mu_2\) is the mean of Aspirin 2

\(\sigma^2_1\) is variance of Aspirin 1

\(\sigma^2_2\) is vairance of Aspirin 2

1b)

t.test(person$AspirinA, person$AspirinB, paired = TRUE)
## 
##  Paired t-test
## 
## data:  person$AspirinA and person$AspirinB
## t = 3.6742, df = 9, p-value = 0.005121
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  1.383548 5.816452
## sample estimates:
## mean of the differences 
##                     3.6

conclusion We reject the null hypothesis as the value of p is less than 0.05.

1c)

t.test(person$AspirinA,person$AspirinB,var.equal = TRUE)
## 
##  Two Sample t-test
## 
## data:  person$AspirinA and person$AspirinB
## t = 0.9802, df = 18, p-value = 0.34
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -4.116103 11.316103
## sample estimates:
## mean of x mean of y 
##      19.2      15.6

conclusion We fail to reject the null hypothesis as p value of 0.34 is greater than 0.05

By performing paired t-test we would reject the null hypothesis we got p-value 0.005 while performing the two sampled t-test the p-value is 0.34

2a)

Ho: \(\mu_1 = \mu_2\) - Null Hypothesis

Ha: \(\mu_1 \neq \mu_2\) - Alternative Hypothesis

2b)

time<-data.frame("ActiveX"=c(9.50,10,9.75,9.75,9,13), 
                   "NoX"=c(11.5,12,13.25,11.5,13,9))
mean(time$ActiveX)
## [1] 10.16667
mean(time$NoX)
## [1] 11.70833
var(time$ActiveX)
## [1] 2.041667
var(time$NoX)
## [1] 2.310417

After collecting the data, we noticed sample size is very less, we can visualize the data by boxplot.

boxplot(time$ActiveX, time$NoX, names = c("ActiveX", "NoX"), main="Comparing Boxplot for time in months")

From the boxplot the variances are not equal as time for ActiveX is less spread out when compared to time for NoX. Hence the sample size is very less, so we might want to use non parametric method for analyzing this data

2c)

wilcox.test(time$ActiveX, time$NoX)
## Warning in wilcox.test.default(time$ActiveX, time$NoX): cannot compute exact p-
## value with ties
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  time$ActiveX and time$NoX
## W = 9, p-value = 0.1705
## alternative hypothesis: true location shift is not equal to 0

conclusion

In conclusion, the P-value is 0.17 which is greater than 0.05. So we reject the null hypothesis