6 Inferential statistics


These are hot peppers. Like hot peppers, statistics can cause pain and heartburn if you are not accustomed to them. Ready or not, let’s get munching!!

This week we will begin conducting our first statistical tests! We are going to start small and simple, and we will build complexity during the remainder of the semester. We will also start to make more use of some of the programming techniques that you have been developing, and we will build a foundation for moving into regression models in coming weeks.

We’ll start with some simple methods for testing hypotheses about sampling distributions this week. Although relatively limited in scope within the fields of biology and ecology, these tend to be fairly robust tests, and can be powerful tools if studies are designed thoughtfully. For this week, we will focus on implementation of one-sample t-tests, two-sample t-tests, Wilcox tests, and frequency analysis using a \(\chi^2\) test. Within the context of the assumptions of these tests we will also discuss the F-test and the Shapiro-Wilk test of normality. In short, you probably will learn more statistical tests in this preliminary chapter about statistical inference than you have in your college career to this point. Take your time and soak in all the mathy goodness. We’ll need it!

For this Chapter, we will continue working with packages from the tidyverse. You can go ahead and put this in the top of your code for the chapter if you want to load it all at once:

library(tidyverse)

We will also need the grass carp data for this exercise, which we will load from grasscarp.csv. Remember that you can download all of the class data here or you can get the individual grasscarp.csv file by clicking here and saving with Ctrl + S (Windows) or Command + S (Mac OS-X).

These data come from a long-term study of fish population responses to changes in their primary food source, the invasive hydrilla (Hydrilla verticallata). There are a whole bunch of columns in here! The important variables for this chapter are Year (year of fish collection), Age (the age of each fish), Length (total length of fish in mm), and hydrilla (hectares of hydrilla measured each Year).