This report provides a statistical evaluation for two distinct experimental designs. The first study analyse the comparative bioavailability between two aspirin (Type A and Type B) using a paired design, and independent two-sample approach.
The second study investigates whether active physical stimulation accelerates the walking ages in infant, using a non-parametric method and Mann-Whitney-U due to distributional characteristics.
Ten subjects were administrated both types of the Aspirin with one week of interval with a randomized crossover design. Urine concentration (mg%) measured one hour post-administration. The target of the study is discover whether the mean 1-hour urine concentration of the two drugs are different:
Null Hypothesis \(H_0\): \(\mu_A = \mu_B\) (The mean concentrations of the two drugs are equal).
Alternative Hypothesis \(H_1\): \(\mu_A \neq \mu_B\) (The mean concentrations differ).
# Creating the data frame for the 10 people
aspirin_data <- data.frame(
Subject = 1:10,
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)
)
# Displaying the dataset
knitr::kable(aspirin_data, caption = "Table 1: 1-Hour Urine Concentrations for Aspirin A and B (mg%)")
| Subject | Aspirin_A | Aspirin_B |
|---|---|---|
| 1 | 15 | 13 |
| 2 | 26 | 20 |
| 3 | 13 | 10 |
| 4 | 28 | 21 |
| 5 | 17 | 17 |
| 6 | 20 | 22 |
| 7 | 7 | 5 |
| 8 | 36 | 30 |
| 9 | 12 | 7 |
| 10 | 18 | 11 |
# Paired t-test
paired_test <- t.test(aspirin_data$Aspirin_A, aspirin_data$Aspirin_B, paired = TRUE)
print(paired_test)
##
## Paired t-test
##
## data: aspirin_data$Aspirin_A and aspirin_data$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
The paired t-test yields a p-value of 0.005121. Since this p-value is less than our significance level \(\alpha\) = 0.05, we reject the null hypothesis (\(H_0\)). There is strong statistical evidence to conclude that the mean 1-hour urine concentrations between Aspirin A and Aspirin B are significantly different.
# Executing an unpaired two-sample t-test
unpaired_test <- t.test(aspirin_data$Aspirin_A, aspirin_data$Aspirin_B, paired = FALSE, var.equal = TRUE)
print(unpaired_test)
##
## Two Sample t-test
##
## data: aspirin_data$Aspirin_A and aspirin_data$Aspirin_B
## 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
In this case, the test loses statistical power, because the p-value is 0.34 what is substantial large that fails to reach the significance at \(\alpha\) = 0.05. This highlights the importance acquired by the paired test.
Researchers investigated if active daily exercise routines can shorten the time required for infants to learn how to walk. Twelve male infants from white middle-class families were randomly allocated into two groups: active exercise (n=6) and no active exercises (n=6).
Null Hypothesis \(H_0\): \(\mu_{\text{Active}} \geq \mu_{\text{Control}}\) (Active exercise does not shorten walking age relative to control).
Alternative Hypothesis \(H_1\): \(\mu_{\text{Active}} < \mu_{\text{Control}}\) (Active exercise shortens the mean walking age).
Following the data:
# Data frames for infant walking times
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)
infant_data <- data.frame(
Group = rep(c("Active Exercise", "No Exercise"), each = 6),
Walking_Age_Months = c(active_exercise, no_exercise)
)
# Creating a table
stats_table <- data.frame(
Group = c("Active Exercise", "No Exercise"),
Mean = c(mean(active_exercise), mean(no_exercise)),
SD = c(sd(active_exercise), sd(no_exercise)),
Median = c(median(active_exercise), median(no_exercise))
)
# Displaying the table
knitr::kable(stats_table, caption = "Table 2: Summary Statistics of Infant Walking Ages")
| Group | Mean | SD | Median |
|---|---|---|---|
| Active Exercise | 10.16667 | 1.428869 | 9.75 |
| No Exercise | 11.70833 | 1.520005 | 11.75 |
The small sample size (n=6) shows a low statistical power, which justify the application of a non-parametric test. Beside that, this method protect against outliers without sacrificing test validity.
# Running the Wilcoxon (alpha = 0.05)
mw_test <- wilcox.test(active_exercise, no_exercise, alternative = "less", exact = FALSE)
print(mw_test)
##
## Wilcoxon rank sum test with continuity correction
##
## data: active_exercise and no_exercise
## W = 9, p-value = 0.08523
## alternative hypothesis: true location shift is less than 0
The test yields a p-value of 0.08523. Comparing this to our pre-specified significance level of \(\alpha\) = 0.05, since p > 0.05, we fail to reject the null hypothesis (\(H_0\)). With 5% significance level, there is insufficient statistical evidence to conclude that active exercise shortens the average time for infants to learn how to walk. In order to verify this study, a large sample size is require.
knitr::opts_chunk$set(echo=TRUE, warning=FALSE, message=FALSE)
# Creating the data frame for the 10 people
aspirin_data <- data.frame(
Subject = 1:10,
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)
)
# Displaying the dataset
knitr::kable(aspirin_data, caption = "Table 1: 1-Hour Urine Concentrations for Aspirin A and B (mg%)")
# Paired t-test
paired_test <- t.test(aspirin_data$Aspirin_A, aspirin_data$Aspirin_B, paired = TRUE)
print(paired_test)
# Executing an unpaired two-sample t-test
unpaired_test <- t.test(aspirin_data$Aspirin_A, aspirin_data$Aspirin_B, paired = FALSE, var.equal = TRUE)
print(unpaired_test)
# Data frames for infant walking times
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)
infant_data <- data.frame(
Group = rep(c("Active Exercise", "No Exercise"), each = 6),
Walking_Age_Months = c(active_exercise, no_exercise)
)
# Creating a table
stats_table <- data.frame(
Group = c("Active Exercise", "No Exercise"),
Mean = c(mean(active_exercise), mean(no_exercise)),
SD = c(sd(active_exercise), sd(no_exercise)),
Median = c(median(active_exercise), median(no_exercise))
)
# Displaying the table
knitr::kable(stats_table, caption = "Table 2: Summary Statistics of Infant Walking Ages")
# Running the Wilcoxon
mw_test <- wilcox.test(active_exercise, no_exercise, alternative = "less", exact = FALSE)
print(mw_test)