load("./parenthood.Rdata")
load("./pearson_correlations.RData")
load("./effort.Rdata")
# show that (mean(x),mean(y)) is a point on the model
\[b_1 = \frac{s_y}{s_x}R\]
# compute the slope of the model with this shortcut
lm()
). What values do you get for \(\hat{b}_0\) and \(\hat{b}_1\)? Graph a scatter plot for the
data and include your regression model in the plot.\(\hat{b}_0 =\)
\(\hat{b}_1 =\)
Use cor()
to find \(R^2\) and compare this to what the linear
model function lm()
says it should be.
Use the formula for estimating \(b_1\) in the penguin flipper length data
and verify that it is the same value given by
lm()
.
Use simple linear regression to model the relationship between flipper length and body mass for the penguin data. What values do you get for \(\hat{b}_0\) and \(\hat{b}_1\)? Plot a scatter plot for the data with the line you found.
Use multiple linear regression to model the body mass using the explanatory variables flipper length and bill length for the penguin data. Assuming \(X_1\) is flipper length and \(X_2\) is bill length, what values do you get for \(\hat{b}_0\), \(\hat{b}_1\), and \(\hat{b}_2\)?