For each of the following you should do some exploratory data analysis, i.e. calculate some summary statistics, do the appropriate plots, perform the statistical procedure asked of you. You should record your work by creating an R script and comment each line of your code explaining. All the data sets discussed in the problems are ones we’ve used before or built into R.The built in data sets can be loaded in RStudio using library(datasets) and then explored using View(name)and help(name).
(1) Do a permutation test for difference in means for the built in data set chickwts to test for a difference in average weight for different feeds. There are many feed options so compare a couple different ones.
(2) Use a permutation test and built in data set airquality to test to see if temperatures above 85 have increased atmospheric ozone on average.
(3) Do a permutation test for independence in the GSS2002 between at least two pairs of interesting variables (don’t do the one from the book).
(4) Use the chi-squared test for independence using built in data set UCBAdmission to see if being admitted to department A is independent of sex. Do a similar test for the other departments.
This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.
# Do a permutation test for difference in means for the built in data set chickwts to test for a
# difference in average weight for different feeds. There are many feed options so compare a couple
# different ones.
# weight feed
# Min. :108.0 casein :12
# 1st Qu.:204.5 horsebean:10
# Median :258.0 linseed :12
# Mean :261.3 meatmeal :11
# 3rd Qu.:323.5 soybean :14
# Max. :423.0 sunflower:12
linseed.weight <- subset(chickwts, feed=="linseed", select=weight)$weight
sunflower.weight <- subset(chickwts, feed=="sunflower", select=weight)$weight
soybean.weight <- subset(chickwts, feed=="soybean", select=weight)$weight
d <- c(linseed.weight,sunflower.weight)
d2 <- c(sunflower.weight, soybean.weight)...
This is only a preview of the solution. Please use the purchase button to see the entire solution