Chapter 5 of 10
Quantifying Life: Data Tables, Graphs, and Basic Statistics
Transform raw numbers into biological insight by organizing data, choosing the right graph, and applying simple statistics to real experiments.
From Raw Numbers to Biological Insight
Why Quantifying Matters
You have learned how to collect good measurements. Now you will turn those measurements into biological insight using tables, graphs, and simple statistics.
The Common Workflow
Most biology projects follow this pattern: collect data, organize in tables, visualize with graphs, summarize with statistics, then interpret in terms of the biological question.
Our Running Example
Example: radish seedlings grown under white vs red light. You measure height after 7 days. You will learn to table, graph, and summarize these numbers.
Step 1: Organizing Data into Clear Tables
Table Design Rules
Good tables follow simple rules: one row per observation, one column per variable, clear units in headers, and raw data separated from calculated values.
Tidy Data Structure
For plant heights: columns could be PlantID, LightTreatment, Height_cm. Each plant is a row. This tidy format is standard in modern data analysis.
Avoid Common Mistakes
Do not make one column per treatment or mix units into cells like "3.4 cm". Keep numbers numeric and put units only in the column header.
Activity: Fix the Messy Table
You are given a messy summary from a lab partner for the same plant experiment:
- Columns: `White1`, `White2`, `White3`, `Red1`, `Red2`, `Red3`
- Values: `White1 = 3.2`, `White2 = 2.9`, `White3 = 3.5`, `Red1 = 4.1`, `Red2 = 3.8`, `Red3 = 4.0`
- Thought exercise: Rewrite this as a tidy table with three columns: `PlantID`, `LightTreatment`, `Height_cm`.
- Write out at least the first four rows in your notes.
- Check yourself:
- Do you have 6 rows (one per plant)?
- Does each row contain exactly one PlantID, one LightTreatment, and one Height_cm value?
Optional challenge: Add a fourth column `Day` and set it to `7` for all rows to record that these measurements were taken after 7 days.
Step 2: Choosing the Right Graph Type
Why Graph Choice Matters
Graphs reveal patterns that tables hide. The right graph depends on variable types and your biological question: comparing groups, tracking change, or exploring relationships.
Bar, Line, Scatter
Bar graphs: summarize categories (e.g., mean height per treatment). Line graphs: show change over ordered values, often time. Scatter plots: show relationships between two numeric variables.
Categorical vs Numeric
Categorical variables (treatment, species) vs numeric variables (height, time). Categorical often on x-axis of bar/line; numeric on axes of line/scatter.
Modern Best Practice
Many journals encourage plotting individual data points (e.g., dots over bars or box plots) to show variation and sample size, not just means.
Step 3: Building a Simple Bar Graph (Conceptual)
Summarizing the Data
Example means: white light = 3.2 cm, red light = 4.0 cm. You will turn these summary values into a bar graph to compare treatments.
Axes and Summary Table
x-axis: LightTreatment (White, Red). y-axis: MeanHeight_cm. Build a small summary table with one row per treatment and its mean height.
Error Bars and Labels
Add error bars using SD or SEM to show variability. Label axes with units and include a descriptive title so the graph is understandable on its own.
Interpreting the Bars
Visually, the red bar is higher than the white bar, suggesting plants under red light are taller on average. Error bars hint at how variable the data are.
Optional: Plotting and Summaries in Python
If you use Python (a common choice in modern biology courses), you can summarize and plot your data with a few lines of code using `pandas` and `matplotlib`.
Below is a simple example assuming you have a CSV file `plantheights.csv` with columns: `PlantID`, `LightTreatment`, `Heightcm`.
```python
import pandas as pd
import matplotlib.pyplot as plt
1. Load data
df = pd.readcsv('plantheights.csv')
2. Compute mean and standard deviation by treatment
summary = df.groupby('LightTreatment')['Heightcm'].agg(['mean', 'std', 'count'])
print(summary)
3. Make a bar plot with error bars
plt.figure(figsize=(4, 4))
plt.bar(summary.index, summary['mean'], yerr=summary['std'], capsize=5)
plt.ylabel('Plant height (cm) after 7 days')
plt.xlabel('Light treatment')
plt.title('Effect of light color on radish seedling height')
plt.tight_layout()
plt.show()
```
You do not need to memorize this code now. The key idea is that the same concepts (tidy table, group by treatment, compute mean and SD, then plot) apply whether you use Python, R, or a spreadsheet.
Step 4: Mean, Variance, and Standard Deviation
Mean: Center of the Data
The mean is the sum of all values divided by how many values you have. It describes the typical value, like average plant height in a treatment.
Variance: Spread in Squared Units
Variance s² measures how far values are from the mean on average. Formula: s² = Σ(xi − mean)² / (n − 1). It uses squared units.
Standard Deviation: Spread in Original Units
Standard deviation s is the square root of variance. It has the same units as your data and is easier to interpret than variance.
Biological Meaning of SD
Small SD means individuals are similar; large SD means they vary widely. Comparing SDs across treatments shows where variation is higher.
Practice: Compute a Mean and SD by Hand
Use these sample heights (cm) for white light plants: 3.0, 3.4, 3.2, 3.2
- Compute the mean
- Add them: 3.0 + 3.4 + 3.2 + 3.2
- Divide by 4.
- Compute each deviation from the mean
- For each value, calculate (value − mean).
- Square the deviations and sum them
- Add up all (value − mean)².
- Compute the variance (s²)
- Divide the sum of squared deviations by (n − 1) = 3.
- Compute the standard deviation (s)
- Take the square root of the variance.
Check your final answers against a calculator or spreadsheet to see if you get the same mean and SD.
Step 5: Basic Statistical Tests – The Idea of a t-test
Why Use a t-test?
After computing means and SDs, a t-test helps you ask: is the difference between treatments bigger than you would expect from random variation alone?
Core Idea of the t-test
A two-sample t-test compares the difference between two means to the variability within groups and sample size, then gives a p-value under the null hypothesis.
Reading p-values
Conventionally, p < 0.05 is called statistically significant. But this is just a rule of thumb, not a strict truth–false boundary.
Modern Best Practice
Current guidelines stress reporting effect sizes and confidence intervals, and not over-interpreting p-values. Think about biological importance, not just significance.
Quick Check: Graph and Statistic Choices
Test your understanding of graph types and basic statistics.
You measured enzyme activity (units/mL) at 5 different temperatures (10, 20, 30, 40, 50 °C). You want to show how activity changes with temperature. Which graph is most appropriate, and which statistic is most useful to summarize variation at each temperature?
- Bar graph with mean activity only
- Line graph with mean activity at each temperature and error bars showing standard deviation
- Scatter plot with temperature on x-axis and a single mean point on y-axis for each temperature, no error bars
- Pie chart showing percentage of total activity at each temperature
Show Answer
Answer: B) Line graph with mean activity at each temperature and error bars showing standard deviation
Temperature is an ordered numeric variable, and you want to show change across it, so a line graph is appropriate. Showing mean activity with error bars (standard deviation) at each temperature communicates both the trend and the variability.
Key Term Review
Flip through these flashcards to reinforce core concepts from this module.
- Tidy data
- A data format where each row is one observation, each column is one variable, and each cell holds a single value. Standard in modern data analysis.
- Categorical variable
- A variable that represents groups or categories (e.g., treatment type, species, sex), not numeric magnitudes.
- Numeric variable
- A variable measured on a numeric scale (e.g., height, mass, time, temperature) that can be ordered and used in calculations.
- Mean
- The arithmetic average of a set of values: sum of all values divided by the number of values. Describes the central tendency.
- Standard deviation (SD)
- A measure of spread that describes how far values typically are from the mean, in the same units as the data.
- Bar graph
- A graph that uses bars to display summary statistics (often means) for categorical groups, sometimes with error bars.
- Line graph
- A graph that connects summary values (or points) across an ordered variable, usually time or a gradient.
- Scatter plot
- A graph showing individual data points for two numeric variables, used to explore relationships or correlations.
- p-value
- In hypothesis testing, the probability of observing a result at least as extreme as your data if the null hypothesis (no real effect) is true.
- Two-sample t-test
- A statistical test that compares the means of two independent groups, taking into account variability and sample size, to assess evidence for a difference.
Key Terms
- mean
- The arithmetic average of a set of values, calculated as the sum of the values divided by their count.
- p-value
- In null-hypothesis significance testing, the probability of obtaining results at least as extreme as those observed, assuming the null hypothesis is true.
- variance
- A measure of how far data points spread out from the mean, defined as the average of the squared deviations from the mean (using n − 1 for a sample).
- bar graph
- A graph that uses bars to represent summary statistics (often means) for different categories.
- tidy data
- A standardized data structure where each row is an observation, each column is a variable, and each cell contains a single value.
- line graph
- A graph that connects data points with lines to show trends across an ordered variable, often time or a gradient.
- scatter plot
- A graph of individual data points for two numeric variables, useful for visualizing relationships and patterns.
- numeric variable
- A variable that represents measurable quantities and can be used in arithmetic operations (e.g., height, mass, time).
- two-sample t-test
- A statistical test used to compare the means of two independent groups to determine whether there is evidence of a significant difference between them.
- standard deviation
- The square root of the variance, expressing the typical distance of data points from the mean in the original units.
- categorical variable
- A variable that takes on one of a limited, usually fixed, number of possible values, assigning each observation to a group or category.