A <- c(15,26,13,28,17,20,7,36,12,18)
B <- c(13,20,10,21,17,22,5,30,7,11)
Act <- c(9.5,10,9.75,9.75,9,13)
NAct <- c(11.5,12,13.25,11.5,13,9)
One method for assessing the bio availability of a drug is to note its concentration in blood and/or urine samples at certain periods of time after the drug is given. Suppose we want to compare the concentrations of two types of aspirin (types A and B) in urine specimens taken from the same person 1 hour after he or she has taken the drug. Hence, a specific dosage of either type A or type B aspirin is given at one time and the 1-hour urine concentration is measured.
week later, after the first aspirin has presumably been cleared from the system, the same dosage of the other aspirin is given to the same person and the 1-hour urine concentration is noted. Because the order of giving the drugs may affect the results, a table of random numbers is used to decide which of the two types of aspirin to give first. This experiment is performed on 10 people; the results are given in the following table.
Null Hypotheses: \[H_{0}:\mu_A = \mu_B \]
\[ H_{0}: \mu_A - \mu_B = 0 \]
Alternative Hypotheses :\[H_{a}: \mu_A \neq \mu_B \]
\[ H_{a}: \mu_A - \mu_B \neq 0 \]
t.test(A,B,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
Since the p-value is lower than \(\alpha\) (p-value = 0.005121), we fail to reject the null hypothesis that the means are equal.
t.test(A,B, 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
Since the p-value for the two sample t-test is greater than \(\alpha\) (p-value = 0.3401), we will reject the null hypothesis
Can active exercise shorten the time that it takes an infant to learn how to walk alone? Researchers randomly allocated12 one-week old male infants from white, middle class families to one of two treatment groups. The is theactive exercise group received stimulation of the walking reflexes for four 3-minute sessions each day from the beginning of the second week through the end of the eighth week. Those in the other group received no such stimulation. Is there sufficient evidence to conclude that the groups differ in the typical time required to first walking?
Null Hypotheses: \[H_{0}:\mu_A = \mu_B \]
\[ H_{0}: \mu_A - \mu_B = 0 \]
Alternative Hypotheses :\[H_{a}: \mu_A \neq \mu_B \]
\[ H_{a}: \mu_A - \mu_B \neq 0 \]
Since the collected data is not big enough we can not perform a normality test. Therefore, we are not able to judge the skewness of data.
wilcox.test(Act,NAct)
## Warning in wilcox.test.default(Act, NAct): cannot compute exact p-value with
## ties
##
## Wilcoxon rank sum test with continuity correction
##
## data: Act and NAct
## W = 9, p-value = 0.1705
## alternative hypothesis: true location shift is not equal to 0
Since the p-value is greater than \(\alpha\), we will reject the null hypothesis and choosing the alternative hypothesis.
Therefore, we can conclude that they differ in typicall time required in first walking
# --------------------- Question 01
# ---- Item b
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)
# ---- Item c
t.test(A,B, paired=FALSE)
# --------------------- Question 02
Act <- c(9.5,10,9.75,9.75,9,13)
NAct <- c(11.5,12,13.25,11.5,13,9)
wilcox.test(Act,NAct)