Biosciences: Statistical Methods

This is an interactive courseware module that teaches the basics of statistics using biological examples.
Updated 30 Apr 2024

Biosciences: Statistical Methods

View Module on File Exchange or Open in MATLAB Online

This curriculum module uses biological data to teach fundamental concepts of statistics, data analysis, and data visualization.


This module will teach students how to use statistical methods in MATLAB® to analyze ecologically relevant data. We will explore the data using descriptive statistics, fit the data using a predictive model, find the linear correlations between variables, and finally, discuss how to test a hypothesis.Make sure you're familiar with the basics of using MATLAB by going through the MATLAB Onramp before continuing. We also recommend reviewing the Biosciences Data module.

This module utilizes the Palmer penguins [1] dataset, which contains data about three different species of penguin in Antarctica.

A Gentoo penguin spreading its flippers


This module assumes basic MATLAB knowledge and it is recommended that all students take the MATLAB Onramp and go through the related Biosciences Data curriculum module.

Getting Started

To learn more about opening and using MATLAB, see the accompanying Getting Started guide.


Notes: These scripts can all be run independently, though we recommend going through these live scripts in order. These live scripts are intended to be used with output inline. To change the output, go to the View tab of the toolstrip, and select Output Inline. The scripts have areas for the students to interact with the code . There will also be exercises in most scripts and the answers will be provided at the end. A problem set for students to practice these concepts is also included here. Throughout the scripts, there are also moments to students to reflect on what they've learned or on what the data means . Particularly interesting examples of how these concepts are used in "real-world" biology are also pointed out .


  • Learning objective: Students learn about why statistical methods are important in biology.

Load and clean the data

  • Learning objective: Students will learn how to clean data and prepare a dataset for analysis.

Further explore and visualize penguins

  • Learning objective: Students will learn how to use histograms and box plots to understand the distribution of data.

Descriptive statistics

  • Learning objective: Students will learn to calculate and interpret descriptive statistics including mean, median, and standard deviation.

Predictive modeling

  • Learning objective: Students will learn how to fit linear regression models to data and make predictions about the data.


  • Learning objective: Students will learn how to calculate and visualize linear correlations between variables.

Hypothesis testing

  • Learning objective: Students will learn to create null and alternate hypotheses, test them using t-tests, and interpret p-values.

Problem set

Related Courseware Modules

Link to 5 other modules here once set up.


MATLAB®, Statistics and Machine Learning Toolbox™, Curve Fitting Toolbox™


[1] Horst AM, Hill AP, Gorman KB (2020). palmerpenguins: Palmer Archipelago (Antarctica) penguin data. R package version 0.1.0. doi:10.5281/zenodo.3960218.


The License for this project is in the License.txt file in this repository.

© Copyright 2023 The MathWorks, Inc.

Cite As

Emma Smith Zbarsky (2024). Biosciences: Statistical Methods (, GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2023a
Compatible with R2023a and later releases
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.