# Playing with the dice data from class # This is how we did it in class. We were jumping around a little in # the order we executed stuff, so make sure the names of the columns # of the data frames you're using are the correct ones. # The data: group1a <- c(0,2,1,1,3,1,1,0,1,0,0,2,2,1,1,1,1,1,1,1,2,1,0,1,1,2,2,1,1,0,0,2,2,2,2,2,1,0,1,1,0,0,0,3,0,1,3,1,2,0,0,0,1,0,1,1,2,0,1,1,0,2,1,1,1,1,2,1,3,0,0,1,2,0,3,1,1,1,1,1,1,0,0,2,1,1,1,2,1,2,1,0,0,0,0,1,2,0,3,2) group1b <- read.csv("http://cs.marlboro.edu/courses/spring2013/statistics/wiki/wiki.attachments/Dice_Rolls.csv") group1b <- as.vector(group1a$X0) group1 <- c(group1a, group1b) group2a <- read.csv("http://cs.marlboro.edu/courses/spring2013/statistics/wiki/wiki.attachments/Jar_3.csv") group2a <- as.vector(group2a$X0) group2b <- read.csv("http://cs.marlboro.edu/courses/spring2013/statistics/wiki/wiki.attachments/DieData.csv") group2b <- as.vector(group2b$X1) group2c <- read.csv("http://cs.marlboro.edu/courses/spring2013/statistics/wiki/wiki.attachments/sherpa.csv") group2c <- as.vector(group2c$X2) group2 <- c(group2a, group2b, group2c) group3 <- read.csv("http://cs.marlboro.edu/courses/spring2013/statistics/wiki/wiki.attachments/Number_of_sixes.csv") group3 <- as.vector(group3$Number.of.6s) # Point estimates for the means: mean(group1) mean(group2) mean(group3) # The margin of error (normal distribution, 99% confidence): qnorm(0.995) * sd(group1) / sqrt(length(group1)) qnorm(0.995) * sd(group2) / sqrt(length(group2)) qnorm(0.995) * sd(group3) / sqrt(length(group3))