Problem 1

we want to test the hypothesis that the mean concentrations of the two drugs are the same in urine specimens. the appropriate hypothesis: A) H0: meanA=meanB

the alternative hypothesis will be: meanA!=meanB

  1. Testing the hypothesis using a paired t-test, report the p-value and state your conclusion (alpha = 0.05)
A<-c(15, 26, 13, 28, 17, 20, 7, 36, 12, 18)
B<-c(13, 20, 10, 21, 17, 22, 5, 30, 7, 11)
dat<-cbind(A,B)
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 difference in means is not equal to 0
## 95 percent confidence interval:
##  1.383548 5.816452
## sample estimates:
## mean of the differences 
##                     3.6

p-value = 0.005121 <<< alpha=0.05 conclusion: we fail to reject Ho

  1. Suppose that you tested this hypothesis using a two-sample t-test (instead of a paired t-test).
A<-c(15, 26, 13, 28, 17, 20, 7, 36, 12, 18)
B<-c(13, 20, 10, 21, 17, 22, 5, 30, 7, 11)
dat<-cbind(A,B)
t.test(A,B, paired=FALSE,var.equal = TRUE)
## 
##  Two Sample t-test
## 
## data:  A and 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

the p-value of our two sample t-test is 0.34

PROBLEM 2

a Stating the null and alternative hypothesis Null hypothesis H0: mean time of AE = mean time of NE and the alternative will be mean time of AE != mean time of NE

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

AE<-c(9.50, 10.00, 9.75, 9.75, 9.00, 13.00)
NE<-c(11.50, 12.00, 13.25, 11.50, 13.00, 9.00)

qqnorm(AE,main="Active Exercise")

qqnorm(NE, main=" No Exercise ")

qqnorm(c(AE, NE), main= "normal probality plot")

> the sample size of the data are too small therefore we choose to use the non parametric test. Also from the normal probability plot , we can observe that the distribution of the data for both groups is not normal.

  1. Analysis using the Mann-Whitney-U test using R with alpha=0.05
wilcox.test(AE, NE)
## Warning in wilcox.test.default(AE, NE): cannot compute exact p-value with ties
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  AE and NE
## W = 9, p-value = 0.1705
## alternative hypothesis: true location shift is not equal to 0

the p-value fron the Mann-Whitney-U Test is p=0.1705 >>> alpha=0.05

Conclusion: Fail to reject the null hypothesis.