2026 COMPLETE QUESTIONS AND CORRECT
ANSWERS GRADED A+
◉ In regularization, we penalize:
Answer: Complexity
◉ In regularization, we all lambda the:
Answer: penalty
◉ How many models does lass regression create?
Answer: 100
◉ Which IC does the gamlr function use by default?
Answer: AICc
◉ The sampling distribution is the
Answer: distribution of a statistic (like the mean) across many
repeated samples
◉ What does this line do?(xbar <- mean(ames$SalePrice))
,Answer: Calculates the sample mean of SalePrice and stores it in
xbar. The parentheses also print the result
◉ What does ames$SalePrice mean?
Answer: It selects the SalePrice column from the data frame ames
◉ What does this line do?(se <-
sd(ames$SalePrice)/sqrt(nrow(ames)))
Answer: Computes the standard error of the sample mean using
sample SD divided by square root of sample size
◉ What does sd(ames$SalePrice) do?
Answer: Finds the sample standard deviation of home sale prices
◉ n(row) is essentially the:
Answer: sample size
◉ What does this line do?xbar + c(-1.96,1.96)*se
Answer: Builds a 95% confidence interval by taking the estimate
plus and minus 1.96 standard errors
◉ What does c(-1.96,1.96) do?
, Answer: Creates a two-number vector so R returns both the lower
and upper confidence interval endpoints
◉ What does this line do?fit <- glm(log(SalePrice) ~ .-Neighborhood,
data=ames)
Answer: Fits a regression model predicting log(SalePrice) using all
variables in ames except Neighborhood
◉ What does log(SalePrice) mean in the model?
Answer: The response variable is the natural log of sale price, not
the raw sale price
◉ What does the . mean in a formula?
Answer: Use all other variables in the dataset as predictors
◉ What does this line do?(bstats <-
summary(fit)$coef["Central.AirY",])
Answer: Pulls the regression output row for the Central.AirY
coefficient and stores it in bstats
◉ What does summary(fit)$coef give you?
Answer: The coefficient table, including estimate, standard error, t-
value, and p-value. The significance-testing slides emphasize
interpreting this output