Question 1:

One method for assessing the bioavailability 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.

One 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.

Input the data:

Person <-c(1,2,3,4,5,6,7,8,9,10)
AspirinA <- c(15,26,13,28,17,20,7,36,12,18)
AspirinB<- c(13 ,20 ,10 ,21,    17, 22, 5   ,30 ,7, 11)

Part A

Suppose we want to test the hypothesis that the mean concentrations of the two drugs are the same in urine specimens. State the appropriate hypothesis.

Null Hypothesis: Ho:mu1=mu2 or mu1-mu2=0

Alternative Hypothesis: mu1≠mu2 or mu1-mu2≠0

Part B

Test the hypothesis using a paired t-test, report the p-value and state your conclusion (alpha = 0.05)

t.test(AspirinA,AspirinB,paired=TRUE)
## 
##  Paired t-test
## 
## data:  AspirinA and AspirinB
## t = 3.6742, df = 9, p-value = 0.005121
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  1.383548 5.816452
## sample estimates:
## mean of the differences 
##                     3.6

There is evidence that the two means are not equal. Because our pvalue is .005<.05, we do reject the null hypothesis.

Part C

Suppose that you tested this hypothesis using a two-sample t-test (instead of a paired t-test). What would the p-value of your test have been?

t.test(AspirinA,AspirinB,paired=FALSE)
## 
##  Welch Two Sample t-test
## 
## data:  AspirinA and AspirinB
## 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 non-paired test, we can see that our p-value is now .3401, which would imply that the is not enough evidence to reject the null hypothesis, since pvalue>.05

These two tests confirm our notion that the paired t test is stronger when there is a correlation between the two populations.

Question 2

Can active exercise shorten the time that it takes an infant to learn how to walk alone? Researchers randomly allocated 12 one-week old male infants from white, middle class families to one of two treatment groups. The is the active 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.

Input the data:

Active <- c(9.5 ,10,    9.75,   9.75,   9,  13)
Not <- c(11.5,  12, 13.25,  11.5,   13, 9)

Part A

State the null and alternative hypothesis

Null Hypothesis: Ho:mu1=mu2 or Mu1-mu2=0

Alternative Hypothesis: mu1≠mu2 or mu1-mu2≠0

Part B

Why might you want to use a non-parametric method for analyzing this data?

The sample sizes are very small, additionally, they are not normally distributed, as shown by the graphs below.

qqnorm(Active,main="Active Excercisers Normal Probability")

qqnorm(Not,main="Not Active Excercisers Normal Probability")

We can see that the Active group appears to be skewed to the right, while the Not Active group is skewed to the left. Because these are not normally distributed, we should not use a parametric test. We can also get a sense of the variances by looking at the boxplots

boxplot(Active,Not,names=c('Active','Not Active'),main='Active vs Not Active Boxplots')

We can see here that the variances are not at all equal, as our Active group is clearly tightly centered around 10, and our Not Active group is more widely spread around 12.

These two things indicate to us that our data cannot be used in the traditional parametric tests.

Part C

Analyze using the Mann-Whitney-U test using R with alpha=0.05

wilcox.test(Active,Not)
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  Active and Not
## W = 9, p-value = 0.1705
## alternative hypothesis: true location shift is not equal to 0

Since our p-value of .1705 here is greater than the alpha of .05 we do not reject the null hypothesis and state that there is not enough evidence to indicate the two samples have different means.

All code used:

Person <-c(1,2,3,4,5,6,7,8,9,10)
AspirinA <- c(15,26,13,28,17,20,7,36,12,18)
AspirinB<- c(13 ,20 ,10 ,21,    17, 22, 5   ,30 ,7, 11)

t.test(AspirinA,AspirinB,paired=TRUE)

t.test(AspirinA,AspirinB,paired=FALSE)

Active <- c(9.5 ,10,    9.75,   9.75,   9,  13)
Not <- c(11.5,  12, 13.25,  11.5,   13, 9)

qqnorm(Active,main="Active Excercisers Normal Probability")
qqnorm(Not,main="Not Active Excercisers Normal Probability")

boxplot(Active,Not,names=c('Active','Not Active'),main='Active vs Not Active Boxplots')

wilcox.test(Active,Not)