1. 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)
Stating the hypothesis
Null Hypothesis: The mean concentration of the two drugs is the same,
that means the difference of the means (D) is zero. Hypothesis is
D=0.
Alternate Hypothesis: The mean concentration of the two drugs are
different, that means the difference of the means (D) is not zero.
Hypothesis is D not equal to 0.
Testing the hypothesis using a paired t-test
t.test(A,B, paired=TRUE, sig.level=0.05)
##
## 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
The P-value determined from computing a paired t-test with an alpha
of 0.05 is equal to 0.0051. The calculated mean difference is 3.6.
Two-Sample T-Test
t.test(A,B, sig.level=0.05, type="two.sample")
##
## 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
Using a two-sample t-test, the computed p-value is 0.34, which is
much greater than the p-value computed using the paired t-test.
2. Analysis of Exercise Related data
Null Hypothesis : There is no significant difference between the mean
of population of the timing of the infants who received active exercise
& the mean of the population of the timing of the infants who did
not receive exercise.
In mathematical term : H_o : Mean_active_exercisers =
Mean_Non_exercisers
Alternative Hypothesis : The mean of population of the timing of the
infants who performed active exercise is less that the mean of the
population of the timing of the infants who did not perform
exercise.
In mathematical term : H_a : Mean_active_exercisers <
Mean_Non_exercisers
active <- c(9.5, 10, 9.75, 9.75,9,13)
non_active <- c(11.5,12, 13.25,11.5,13,9)
hist(active, main = "Histogram of timings of infants receiving active exercise")

hist(non_active, main = "Histogram of timings of infants not receiving exercise")

boxplot(active,non_active, names = c("active", "non-active"))

Looking at the Histograms of both populations , the skewness of the
first population(active exercisers) is more right skewed than the second
population (non-excerisers). The variation of the first population is
different than that of the second population. From these difference in
variation, skewness and the sample size being small(n=6), we can justify
the use of non-parametric method for analyzing the data.
wilcox.test(active, non_active, alternative = "less", exact=FALSE, conf.level=0.95)
##
## Wilcoxon rank sum test with continuity correction
##
## data: active and non_active
## W = 9, p-value = 0.08523
## alternative hypothesis: true location shift is less than 0
Since p-value(0.08523) is more than alpha(0.05), our
test-statistic(W) falls on “fail to reject null hypothesis” region.
Therefore, we fail to reject null hypothesis. Which means, we cannot say
with confidence that exercise is helping shorten the time it takes for
the infants to learn to walk.
A<-c(15,26,13,28,17,20,7,36,12,18)
B<-c(13,20,10,21,17,22,5,30,7,11)
t.test(A,B, paired=TRUE, sig.level=0.05)
t.test(A,B, sig.level=0.05, type="two.sample")
active <- c(9.5, 10, 9.75, 9.75,9,13)
non_active <- c(11.5,12, 13.25,11.5,13,9)
hist(active, main = "Histogram of timings of infants receiving active exercise")
hist(non_active, main = "Histogram of timings of infants not receiving exercise")
boxplot(active,non_active, names = c("active", "non-active"))
wilcox.test(active, non_active, alternative = "less", exact=FALSE, conf.level=0.95)