## Question

(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.

## Solution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

library(datasets)#View(chickwts)

#help(chickwts)

# (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.

summary(chickwts)

# 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)...

By purchasing this solution you'll be able to access the following files:

Solution.R.