Figure 1.1 from Wood 2006

plot(hubble\(x,hubble\)y,xlab=“Distance (Mpc)”, ylab=expression(“Velocity (km”s^{-1}“)”))

HubbleLM = lm(hubble\(y~hubble\)x) summary(HubbleLM) coef(HubbleLM)

hist(hubble\(x, breaks = 30,probability = T ,main = "Histogram of Galaxy Distance", xlab = "Distance") lines(density(hubble\)x), col=“red”, lwd=2)

hist(hubble\(y, breaks = 30,probability = T ,main = "Histogram of Galaxy Velocity", xlab = "Velocity") lines(density(hubble\)y), col=“blue”, lwd=2)

Problem 2

df.challenger <- read.csv(“https://www.dropbox.com/s/ezxj8d48uh7lzhr/challenger.csv?dl=1”) plot(df.challenger\(Temp,df.challenger\)O.ring,xlab=“Temperature”,ylab=“Number of incidents”)

N = B0 + B1*T

N = average number of O-ring failiures on a launch day with the given conditions

T = Outside Temperature at time of launch

B0 = The intercept of the model.

B1 = The slope of T. How much each marginal unit of temperature changes the average number of O-ring failiures.

ChallengerML = lm(df.challenger\(O.ring ~ df.challenger\)Temp) summary(ChallengerML) coef(ChallengerML)

abline(ChallengerML)