Get startedGet started for free

Beak length to depth ratio

The linear regressions showed interesting information about the beak geometry. The slope was the same in 1975 and 2012, suggesting that for every millimeter gained in beak length, the birds gained about half a millimeter in depth in both years. However, if we are interested in the shape of the beak, we want to compare the ratio of beak length to beak depth. Let's make that comparison.

Remember, the data are stored in bd_1975, bd_2012, bl_1975, and bl_2012.

This exercise is part of the course

Statistical Thinking in Python (Part 2)

View Course

Exercise instructions

  • Make arrays of the beak length to depth ratio of each bird for 1975 and for 2012.
  • Compute the mean of the length to depth ratio for 1975 and for 2012.
  • Generate 10,000 bootstrap replicates each for the mean ratio for 1975 and 2012 using your draw_bs_reps() function.
  • Get a 99% bootstrap confidence interval for the length to depth ratio for 1975 and 2012.
  • Print the results.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Compute length-to-depth ratios
ratio_1975 = ____
ratio_2012 = ____

# Compute means
mean_ratio_1975 = ____
mean_ratio_2012 = ____

# Generate bootstrap replicates of the means
bs_replicates_1975 = ____
bs_replicates_2012 = ____

# Compute the 99% confidence intervals
conf_int_1975 = ____
conf_int_2012 = ____

# Print the results
print('1975: mean ratio =', mean_ratio_1975,
      'conf int =', conf_int_1975)
print('2012: mean ratio =', mean_ratio_2012,
      'conf int =', conf_int_2012)
Edit and Run Code