# HW6soln - STAT 425 HW6 Suggested Solution 1(a We can rst...

• Homework Help
• 6
• 100% (6) 6 out of 6 people found this document helpful

This preview shows page 1 - 3 out of 6 pages.

STAT 425 HW6 Suggested Solution 1. (a) We can first save the data into a local file and use R command to read the data into R. We may use the following code and get the summary for the data set. > football = read.table("Football.txt",header = TRUE); > summary(football); Trial Air Helium Min. : 1.0 Min. :15.00 Min. :11.00 1st Qu.:10.5 1st Qu.:23.50 1st Qu.:24.50 Median :20.0 Median :26.00 Median :28.00 Mean :20.0 Mean :25.92 Mean :26.38 3rd Qu.:29.5 3rd Qu.:28.50 3rd Qu.:30.00 Max. :39.0 Max. :35.00 Max. :39.00 (b) It is appropriate to use paired t-test here to perform our test. By using the following R command we can see the result for our test. > t.test(football\$Air-football\$Helium); One Sample t-test data: football\$Air - football\$Helium t = -0.4198, df = 38, p-value = 0.677 alternative hypothesis: true mean is not equal to 0 95 percent confidence interval: -2.687423 1.764346 sample estimates: mean of x -0.4615385 An alternative way to perform paired t-test is to use the following command. > t.test(football\$Air, football\$Helium, paired = TRUE); Paired t-test data: football\$Air and football\$Helium t = -0.4198, df = 38, p-value = 0.677 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: -2.687423 1.764346 sample estimates: mean of the differences -0.4615385 1
From the summary of the test, since the p-value is 0.677 which is larger than 0.05, we may conclude that the difference between these two balls are not significantly different from 0. We can NOT reject the null hypothesis. (c) By the randomization test introduced in the lecture notes, we can randomly mul- tiply either 1 or -1 to each difference between two balls within one trail, and then by doing so for lots of times we may get the approximated distribution for the test statistics. By using the following code, we can implement the randomization test in R.