10.07.2015 Views

Using R for Introductory Statistics : John Verzani

Using R for Introductory Statistics : John Verzani

Using R for Introductory Statistics : John Verzani

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Using</strong> R <strong>for</strong> introductory statistics 236> A = c(5.8, 1.0, 1.1, 2.1, 2.5, 1.1, 1.0, 1.2, 3.2,2.7)> B = c(1.5, 2.7, 6.6, 4.6, 1.1, 1.2, 5.7, 3.2, 1.2,1.3)> plot(density(A))> lines(density(B))The graph (not shown) suggests that the populations are skewed with long tails. As such,the t-test assumptions are not met. However, we also see that the sam-Table 8.7 Ten checkout times <strong>for</strong> two grocerycheckersCheckerTimeschecker A 5.8 1.0 1.1 2.1 2.5 1.1 1.0 1.2 3.2 2.7checker B 1.5 2.7 6.6 4.6 1.1 1.2 5.7 3.2 1.2 1.3ples appear to have densities with the same shape, so the rank-sum test is available. Atwo-sided test can be done with> wilcox.test(A,B)Wilcoxon rank sum test with continuitycorrectiondata: A and BW = 34, p-value = 0.2394alternative hypothesis: true mu is not equal to aThe p-value is not significant. babies8.6.4 Problems8.28 A 2003 study at the Cleveland Clinic compared the effects of two cholesterol drugs,atorvastatin and pravastatin, on middle-aged heart-disease patients. It was found that theatorvastatin treatment group had an average LDL level of 79 after treatment, whereas thepravastatin group had an average LDL level of 110. Suppose the two groups contained250 patients each, and the sample standard deviations were 25 <strong>for</strong> the atorvastatin groupand 20 <strong>for</strong> the pravastatin. If the populations are assumed to be normally distributed,per<strong>for</strong>m a two-sample test to compare whether the mean LDL levels <strong>for</strong> atorvastatin arelower than those <strong>for</strong> pravastatin, or whether the differences are explainable by chancevariation.8.29 A test to determine whether echinacea is beneficial in treating the common coldwas set up as follows. If a child reported cold symptoms, then he was randomly assignedto be given either echinacea or a placebo. Recovery time was measured and issummarized in Table 8.8. Is this statistical evidence that children in the echinacea grouphad a quicker recovery?Table 8.8 Recovery time <strong>for</strong> different treatmentgroups

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!