Homework6 stat425 - setwd/Users/Bcollender/STAT 425...

This preview shows page 1 out of 1 page.

setwd("/Users/Bcollender/STAT 425") getwd() #question 1 Data1 <- read.table("football.csv", header=TRUE) summary(Data1) t.test(Data1$Helium-Data1$Air) tstats = replicate(100000, + t.test( (Data1$Helium - Data1$Air)* + sample(c(-1,1),10,replace=TRUE) )$statistic) t.observed = t.test(Data1$Helium - Data1$Air)$statistic approx.pval = mean(abs(tstats) >= abs(t.observed)) approx.pval hist(tstats, breaks = 50, freq = FALSE, col = "grey90") abline(v=c(t.observed,-t.observed), lty=2, col="red") lines(seq(-5,5,len=100), dt(seq(-5,5,len=100), df=9), col="blue") #question 2

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture