MATH 314 Homework 08

Due 2026-11-03 by 11:59pm

  1. Quiz17++: Use Polars and the penguins dataset to calculate single sample confidence intervals of bill_length_mm for each species of penguin.

    Recall our formula for (CLT) confidence intervals:

    Use the notes from Thursday's class to calculate an appropriate value of dependent on the number of observations for each species.

  2. Generalize your answer from number 1. into a function that takes three arguments

    def CIs(df, x="", g=""):
        ...
    
    • df is the dataframe from which confidence intervals will be cacluated.

    • x is the numeric variable's name.

    • g is the grouping variable's name. g should be categorical or qualitative, not be numeric.

  3. Call your function on the dataframe about penguins, to calculate confidence intervals of "body_mass_g", grouping by "island".