Homework6 - Brianna Collender NetID Collend2 Homework 6 1...

This preview shows page 1 - 2 out of 4 pages.

Brianna Collender NetID: Collend2 Homework 6 1. R-code with questions a. > #question 1 > Data1 <- read.table("football.csv", header=TRUE) > summary(Data1) 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. > t.test(Data1$Helium-Data1$Air) One Sample t-test data: Data1$Helium - Data1$Air t = 0.4198, df = 38, p-value = 0.677 alternative hypothesis: true mean is not equal to 0 95 percent confidence interval: -1.764346 2.687423 sample estimates: mean of x 0.4615385 CONCLUSION: the p-value is greater than alpha (.05) therefore we fail to reject the null. c. > tstats = replicate(100000, + + t.test( (Data1$Helium - Data1$Air)* + + sample(c(-1,1),10,replace=TRUE) )$statistic) There were 50 or more warnings (use warnings() to see the first 50) > t.observed = t.test(Data1$Helium - Data1$Air)$statistic > approx.pval = mean(abs(tstats) >= abs(t.observed)) > approx.pval [1] 0.78035 CONCLUSION: the p-value is still greater than alpha (.05) and we still fail to reject the null hypothesis.

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture