Statement of the Appropriate Hypothesis:
Let \(\mu_A\) and \(\mu_B\) be the popultion mean 1 hr during contectrations for aspirin A and B.
The Hypothesis are:
\[ H_0: \mu\_A = \mu\_B\]
\[H_1: \mu\_A \neq \mu\_B \]
#Aspirin Urin Samples T - Types
A <- c(15,26,13,28,17,20,7,36,12,18)
B <- c(13,20,10,21,17,22,5,30,7,11)
## Paired- T Test
?t.test
t.test(A, B , alternative = c("two.sided"), paired = TRUE)
##
## Paired t-test
##
## data: A and 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
Comments: In this observation the P-Value is 0.005121 and compare to significance level \(\alpha\) = 0.05. From the calculation we can state that out P-Value is lesser than the given \(\alpha\) = 0.05. So, we can reject the null hypothesis \(H_0\)
##Question 1(C) - Two - Sample T Test
t.test(A, B , alternative = c("two.sided"), paired = FALSE)
##
## Welch Two Sample t-test
##
## data: A and 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
Comments: In this observation the P-Value is 0.3401
Statement of the null and alternative hypothesis:
Let \(\mu_A\) and \(\mu_N\) be the time for active and Non active exercise.
The Hypothesis are:
\[ H_0: \mu\_A = \mu\_N\]
\[H_a: \mu\_A < \mu\_N \]
E <- c(9.5, 10.0, 9.75, 9.75, 9.0, 13.0)
N <- c(11.50, 12.0, 13.25, 11.50, 13.0, 9.0)
qqnorm(E, main = "Normal Q-Q Plot For Active Exercise")
qqnorm(N, main = "Normal Q-Q Plot for No- Active Exercise")
boxplot(E,N)
Comments: Due to our Data is not normally distributed so we need to do Non- Parametric T-Test
wilcox.test(E,N,alternative = c("less"),conf.int = FALSE, conf.level = 0.95)
##
## Wilcoxon rank sum test with continuity correction
##
## data: E and N
## W = 9, p-value = 0.08523
## alternative hypothesis: true location shift is less than 0
Comment: Comments: In this observation the P-Value is 0.08523 and compare to significance level \(\alpha\) = 0.05. From the calculation we can state that out P-Value is greater than the given \(\alpha\) = 0.05. So, we can NOT reject the null hypothesis \(H_0\)
#Conclusions:
#Aspirin Urin Samples T - Types
A <- c(15,26,13,28,17,20,7,36,12,18)
B <- c(13,20,10,21,17,22,5,30,7,11)
## Paired- T Test
t.test(A, B , alternative = c("two.sided"), paired = TRUE)
##Question 1(C) - Two - Sample T Test
t.test(A, B , alternative = c("two.sided"), paired = FALSE)
## The Reasoning of using Non Parametric Test
E <- c(9.5, 10.0, 9.75, 9.75, 9.0, 13.0)
N <- c(11.50, 12.0, 13.25, 11.50, 13.0, 9.0)
qqnorm(E, main = "Normal Q-Q Plot For Active Exercise")
qqnorm(N, main = "Normal Q-Q Plot for No- Active Exercise")
boxplot(E,N)
## Analyze the Man-Whitney U -Test
wilcox.test(E,N,alternative = c("less"),conf.int = FALSE, conf.level = 0.95)