(2 pts)Suppose we have samples of 5 men and 5 women and have conducted a randomization test to compare the sexes on the variable Y = pulse. In addition, suppose we have found that in 120 out of 252 possible outcomes under the randomization permutation, the difference in means is at least as large as the difference in the two observed sample means. Does this test provide evidence that the sexes differ with regard to pulse? Briefly justify your answer.

This randomization test does not provide significant evidence that the sexes differ with regard to pulse. 120/252 (p=0.4762) randomization yields a difference in sample means as far from zero as the original sample mean difference.

p<-120/252;p
## [1] 0.4761905

In order to determine whether there is difference in the means of the two groups at the 5% significance level (), state the test null and alternative hypotheses. Be specific in your notation.

Ho: mu(heart disease) = mu(control); There is no difference in serotonin levels between those with heart disease and those without heart disease. Ha: mu(heart disease) != mu(control); There is a signifcant difference in serotonin levels between those with heart disease and those without heart disease.


Are we supposed to be able to infer hypotheses tests from table without text. I am assuming ng/gm is nangrams/gram and is blood concentration of serotonin in these two populations (one with heart disease and one without.) *** ## Use your graphing calculator or R code to report the t-test statistic and p-value of this t-test. CI for Y(hd)-Y(c): (-2237.334, -702.666) with a p value = 0.00127

n_hd<-8
n_c<-12
y_hd<-3840
y_c<-5310
s_hd<-850
s_c<-640

library(BSDA)
## Loading required package: lattice
## 
## Attaching package: 'BSDA'
## The following object is masked from 'package:datasets':
## 
##     Orange
tsum.test(y_hd, s_hd, n_hd, y_c, s_c, n_c)
## 
##  Welch Modified Two-Sample t-Test
## 
## data:  Summarized x and y
## t = -4.167, df = 12.184, p-value = 0.001265
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -2237.3341  -702.6659
## sample estimates:
## mean of x mean of y 
##      3840      5310

Based on the results of your test, write an appropriate test conclusion in context of the problem.

This 95% CI does not contain zero. We reject the null hypothesis, and state that there is significant evidence (p value= 0.00127 <.01) that the two populations are significatnly different. We are 95% confident that those with heart disease have 2237.334 to 702.666 (NG/MG) less Serotonin than those without heart disease. ## What does a type I error mean in the context of the problem? Type I error would mean that we rejected the true null hypothesis that these two populations are not different, and that serotonin concentration (NG/GM) is the same in both populations. ## hat assumptions should be made about the conditions for this test to be appropriate? Observations are from randomly collected samples. Populations are large relative to sample size. Obeservations and samplesare independent of eachother. Sampling distributions are aproximately normal.

effect_size<-(y_c-y_hd)/s_hd;effect_size
## [1] 1.729412

(2 pts) Using the formula,: (where s is from the heart disease group) what is the effect size and carefully interpret your result.

The effect size is 1.729, which means that there is 1.729 standard deviations separarting the overlap of the two distributions, so the difference is important. ## Why might you want to use a Wilcoxon-Mann-Whitney test rather than a t-test? Looking at the histograms of both datasets, the data appears to not reflect a normal distribution. This is likely a result of the smalls ample sizes (n=8) . A Wilcoxon-Mann-Whitney test is used in this instance because it is a nonparametric test, not dependent on the mean (or some measure of center which is pretty unrepresentative in data with skews, outliers, non-normal distributions). Again, it does not focus on a parameter of either group, but rather the difference of all data points between each group.

experimental <- c(5.32, 5.60, 5.74, 6.06, 6.32, 6.34, 6.79, 7.18)
control <- c(4.50, 4.78, 4.79, 4.86, 5.41, 5.70, 6.08, 6.21)

hist(experimental)

hist(control)

wilcox.test(experimental, control, alternative = "two.sided",  conf.int = TRUE, conf.level=0.90)
## 
##  Wilcoxon rank sum test
## 
## data:  experimental and control
## W = 53, p-value = 0.02813
## alternative hypothesis: true location shift is not equal to 0
## 90 percent confidence interval:
##  0.24 1.53
## sample estimates:
## difference in location 
##                  0.895

Using the output above from the test, what is your conclusion in context of the problem?

We would reject the null (p-value =0.02813<0.05), there is significant evidence that the population distribution of the experimental group is shifted from the population distribution of the control group. ## Interpret the 90% confidence interval in context of the problem. We are 90% confident (p-value =0.02813), the population distribution of the experimental group is shifted from the population distribution of the control group. The CI (0.24,1.53) does not contain zero, we would state the experimental group is significantly different than the control group.