library(ggplot2)
library(dplyr)

# Prettier graphs
theme_set(theme_bw())

Question 1

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:

# Create freethrow data (copy and paste this into your own R session)
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")
print(freethrow)
##          Make 2nd Miss 2nd
## Make 1st      152       33
## Miss 1st       37        8
  1. What is the null hypothesis of this experiment?
  2. Using the table provided, find a table of expected values for each cell
  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?

Question 2

Reconsider the anorexia data that we investigated in Homework 7:

anorexia <- read.csv("https://collinn.github.io/data/anorexia.txt")

Question 3

This question will again consider the mtcars dataset built into R

data(mtcars)

We will be investigating the relationship between the weight of a car (independent variable) and its miles per gallon (dependent variable). In addition to this, we will also be using the number of carburetors as a second independent variable.