Homework 2 Answers

BSTA 512/612

Modified

January 15, 2026

Answers are not necessarily complete! This is just meant to serve as a check if you are stuck.

Questions

Question 1

Part a

Answer:

Part b

Answer:

term estimate std.error statistic p.value
(Intercept) 1.2819 0.7196 1.7814 0.0753
Fatalism 0.2458 0.0395 6.2273 0.0000

Part c

Answer:

Part d

Answer:

term estimate std.error statistic p.value
(Intercept) 5.4599 0.2087 26.1594 0.0000
FatalismC 0.2458 0.0395 6.2273 0.0000

Part e

Answer:

Question 2


Attaching package: 'palmerpenguins'
The following objects are masked from 'package:datasets':

    penguins, penguins_raw

Part a

# A tibble: 3 × 2
  species   flipper_ave
  <fct>           <dbl>
1 Adelie           190.
2 Chinstrap        196.
3 Gentoo           217.

Part b

Warning: Removed 2 rows containing non-finite outside the scale range
(`stat_summary()`).
Warning: Removed 2 rows containing missing values or values outside the scale range
(`geom_point()`).

Part c

Write out the fitted regression equation that models the flipper length by penguin species. Use LaTeX math markup or insert an image of your equation. Do not yet insert values for the regression coefficients, i.e. use the generic coefficients \(\widehat{\beta}_0, \widehat{\beta}_1\). Use Adelie as the reference level.

Part d

term estimate std.error statistic p.value conf.low conf.high
(Intercept) 189.953642 0.5404799 351.453643 0.000000e+00 188.890526 191.016759
speciesChinstrap 5.869887 0.9699452 6.051772 3.794027e-09 3.962018 7.777756
speciesGentoo 27.233349 0.8066819 33.759714 1.844813e-110 25.646617 28.820082

Part e

How do we interpret each of the regression coefficients for this model? Write out a separate interpretation for each of the coefficients.

Part f

Calculate the mean flipper length (and the 95% CI) of penguins in the Chinstrap and Gentoo species using the predict() function.

Chinstrap penguins: 195.82 mm