hw6 - #1 >#a > helium_football = read.table"HeliumFootball...

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

#1 > #a > helium_football = read.table("HeliumFootball.txt", header = TRUE) > summary(helium_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 > t.test(helium_football$Air-helium_football$Helium) One Sample t-test data: helium_football$Air - helium_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 > #since the p-value 0.677 is greater than 0.5, we fail to reject the null hypothesis. > #There is no mean difference in the distance kicked for the two balls. > > #c > set.seed(5) > t_test = replicate(1000,t.test((helium_football$Air-helium_football$Helium) + *sample(c(-1,1),39,replace=TRUE))$statistic) > observed = t.test(helium_football$Air-helium_football$Helium)$statistic > mean(abs(t_test)>=abs(observed)) [1] 0.689 > #The p-value is still greater than 0.5 after re-randomizatize for 1000 times.

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture