Directions

Show enough work to explain your decisions. Include the relevant R output where requested and state conclusions in context. Use \(\alpha=0.05\) for all three problems.

Problem 1: Free throws

In professional basketball games during the 2009-2010 season, when Kobe Bryant of the Los Angeles Lakers shot a pair of free throws, 8 times he missed both, 152 times he made both, 33 times he made only the first shot, and 37 times he made only the second. Is it possible that the successive free throws are independent, or is there evidence to suggest a “hot streak” effect? The data are tabulated in the freethrow data frame below:

Make 2nd Miss 2nd
Make 1st 152 33
Miss 1st 37 8
## Code for table
freethrow <- matrix(c(152,33,37,8), nrow = 2, byrow = TRUE)
rownames(freethrow) <- c("Make 1st", "Miss 1st")
colnames(freethrow) <- c("Make 2nd", "Miss 2nd")
  1. What is the null hypothesis of this experiment?
  2. Using the table provided, find a table of expected values for each cell. You can just list the expected counts rather than putting into a table, but it may be helpful for you to write it out.
  3. Using your table of observed and expected values, find the \(\chi^2\) statistic associated with this table along with the degrees of freedom
  4. Using your critical value sheet, if we were to test this hypothesis at level \(\alpha = 0.05\), what conclusion would we come to regarding the independence of the first and second free throw?
  5. Confirm your decision with chisq.test() (use the argument correct = FALSE to ensure you find the same \(\chi^2\) statistic as you did in (3))

Problem 2: Vehicle color, odds ratios, and sample size

Recall from the Odds Funsheet that odds compare the number of times an event occurs to the number of times it doesn’t. Here, the odds of red among cars are the number of red cars divided by the number of blue cars. The odds ratio compares those odds to the odds of red among trucks. An odds ratio of 1 means equal odds; a value above 1 means the odds of red are higher among cars.

Two hypothetical studies record the type and color of independently observed vehicles. Study B counts ten times as many vehicles in every cell.

Study A
Red Blue
Car 32 28
Truck 18 22
Study B
Red Blue
Car 320 280
Truck 180 220
## Copy these into your R file to use with chisq.test()

## Data for study A
study_a <- matrix(c(32, 28, 18, 22), nrow = 2, byrow = TRUE,
                  dimnames = list(c("Car", "Truck"), c("Red", "Blue")))

## Data for study B
study_b <- matrix(c(320, 280, 180, 220), nrow = 2, byrow = TRUE,
                  dimnames = list(c("Car", "Truck"), c("Red", "Blue")))
  • Partr A: What is the null hypothesis regarding the relationship between vehicle type and color?

  • Part B: For Study A, calculate the odds of red for cars and for trucks, then find the odds ratio. Interpret it in a sentence using the word odds. Based on this, does there appear to be an association between vehicle type and color?

  • Part C: Run a \(\chi^2\) test of independence on the results from Study A using chisq.test(, correct = FALSE). Report the test statisic, p-values, and degrees of freedom. Based on this, what conclusion do we come to regarding our null hypothesis?

  • Part D: For Study B, find the odds ratio comparing cars to truck. How does this compare to what you found in Part B? Then run a \(\chi^2\) test of independence on Study B. What is your conclusion?

  • Part E: The odds ratio is a measure of effect size, whereas the \(\chi^2\) test of independence is a measure of strength of evidence against a null hypothesis. Comment on the difference between these two ideas, and explain what role the sample size played in both measures

Problem 3: Cow growth

In Homework 5, we compared the bST and Control groups. Now consider all three groups: Control, Testosterone, and bST. The response is each cow’s weight change (post-treatment minus pre-treatment weight). Assume the conditions for a one-way ANOVA are met. The sample mean changes are \(-0.45\) for Control, \(2.76\) for Testosterone, and \(7.26\) for bST, in the dataset’s recorded weight units.

## Load cow data and create difference variable
cow <- read.csv("https://collinn.github.io/data/cowgrowth.csv")
cow <- cow %>% mutate(Diff = Postwt - Prewt)
  • Part A: State the null and alternative hypotheses in terms of the population mean weight changes.
  • Part B: Run summary(aov(Diff ~ Treat, data = cow)) to perform the ANOVA. Use the two mean squares to show how the F statistic was calculated. Which mean square measures variability within the groups?
  • Part C: State your conclusion. A classmate says, “bST had the largest sample mean, so this test proves that its population mean is higher than both others.” Can we draw this conclusion from ANOVA? What specifically does it mean to reject the null hypothesis in this case?