The given data of concentration of Aspirin in urine samples.
A <- c(15, 26, 13, 28, 17, 20, 7, 36, 12, 18)
B <- c(13, 20, 10, 21, 17, 22, 5, 30, 7, 11)
A
## [1] 15 26 13 28 17 20 7 36 12 18
B
## [1] 13 20 10 21 17 22 5 30 7 11
The null hypothesis is: \[H_0: \mu_A = \mu_B\] or, \[H_0: \mu_A - \mu_B = 0\]
The alternative hypothesis is: \[H_A: \mu_A \neq \mu_B\] or , \[H_A: \mu_A - \mu_B \neq 0\]
Here, \(\mu_A\) represents the mean urine concentration for Aspirin A and \(\mu_B\) represents the mean urine concentration for Aspirin B.
The experiment was done with the same 10 people who received both Aspirin A and Aspirin B. So, the observations are paired and not independent.
t.test(A, B, paired = TRUE, alternative = "two.sided", conf.level = 0.95)
##
## 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
Alpha is given 0.05. Since the p-value is less than the significance level (\(p < 0.05\)), we reject the null hypothesis. There is significant evidence that the mean urine concentrations of Aspirin A and Aspirin B are different.
If we test the hypothesis assuming A and B as independent samples:
t.test(A, B, paired = FALSE, alternative = "two.sided", conf.level = 0.95)
##
## 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
The two-sample t-test gives a p-value of approximately:\[p \approx 0.3401\]Using a significance level of \(\alpha = 0.05\), we compare the p-value with alpha:\[0.3401 > 0.05\]Since the p-value is greater than the significance level, we fail to reject the null hypothesis.
Therefore, there is not sufficient evidence to conclude that the mean urine concentrations of Aspirin A and Aspirin B are different when the data are analyzed using a two-sample t-test.
Researchers want to determine whether active exercise shortens the time it takes an infant to learn to walk independently.
There are two independent groups: 1. Active exercise group, 2. No exercise group.
Let \(\mu_A\) represent the typical walking time for infants in the Active Exercise group and \(\mu_N\) represent the typical walking time for infants in the No Exercise group.
The null hypothesis is:\[H_0: \mu_A = \mu_N\]The alternative hypothesis is:\[H_A: \mu_A < \mu_N\]The alternative hypothesis states that infants receiving active exercise tend to walk earlier than infants receiving no exercise. Because the research question specifically asks whether active exercise shortens walking time, this is a one-sided test.
A non-parametric method may be appropriate because the sample sizes are very small, with only 6 infants in each group. With such small samples, it is difficult to reliably verify the assumption of normality required for a two-sample t-test. Therefore, the Mann-Whitney U test, also called the Wilcoxon rank-sum test, can be used to compare the two independent groups without requiring the data to follow a normal distribution.
The walking-time data for the exercise and no exercise group are given below.
active <- 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)
active
## [1] 9.50 10.00 9.75 9.75 9.00 13.00
no_exercise
## [1] 11.50 12.00 13.25 11.50 13.00 9.00
The Mann-Whitney U test:
mw_test <- wilcox.test(active, no_exercise, alternative = "less")
mw_test
##
## Wilcoxon rank sum exact test
##
## data: active and no_exercise
## W = 9, p-value = 0.09524
## alternative hypothesis: true location shift is less than 0
The one-sided p-value is approximately:
\[p \approx 0.085\]
we compare the p-value with alpha:\[0.085 > 0.05\]Since the p-value is greater than the significance level, we fail to reject the null hypothesis. So, at the \(\alpha = 0.05\) significance level, there is not sufficient statistical evidence to conclude that active exercise shortens the time it takes infants to learn to walk independently.