1/124
Looks like no tags are added yet.
Statistical hypothesis
A claim about population parameters
p-value
Probability, under the null model, of a test statistic at least as extreme as the one observed. NOT the probability the null is true
If p > alpha, what do you report?
That the study did not detect an effect (not that the null is proven)
Equivalence and biological importance
Assessed separately from statistical significance
Type I error
Reject a true null hypothesis; false positive
Type II error
Fail to reject a false null hypothesis; false negative
Significance level (alpha)
The chosen Type I error threshold for the testing procedure
Power
Probability of rejecting a false null for a specified alternative; 1 - beta
Three ways to increase power
More independent units, larger true effects, or lower unexplained variation
Risks of deleting an inconvenient outlier
Biases results and hides influential data; exclusions must be documented and justified independently of the effect on significance
Risk of counting subsamples as replicates
Pseudoreplication: treats non-independent measurements as independent, inflating the apparent sample size and false positives
One mean versus a specified value
One-sample t-test
Two linked measurements per independent subject
Paired t-test
Two independent means, unequal variances
Welch's t-test
Two independent means, equal variances
Student's pooled t-test
Independent ordinal or non-normal responses (two groups)
Mann-Whitney or Wilcoxon rank-sum
df for a one-sample t-test
n - 1 (n = 14 gives df = 13)
df for a paired t-test
n - 1, where n counts independent pairs (14 units measured twice gives df = 13)
What values enter a paired t-test?
The within-unit differences (one per pair), not the raw readings
Why is treating 28 readings from 14 units as independent wrong?
Two readings from the same unit are linked; the independent observations are the 14 units/pairs
Assumption check: one-sample t-test
Distribution of observations for small samples; independence from design
Assumption check: paired t-test
The differences, and independence between pairs
Larger samples and non-normality
Larger samples improve robustness to some non-normality
If you transform the data
Apply the transformation consistently and reassess assumptions
Two-sided test
Considers departures in either direction (positive and negative)
One-sided alternative
Specifies a direction before examining results
Link between 95% CI and two-sided test at alpha = 0.05
The test rejects a null value that falls outside the 95% confidence interval
Meaning of a 95% confidence procedure
Covers the fixed parameter in 95% of repeated samples under its assumptions
What a confidence interval summarizes
Precision of the estimate for the parameter
What to report for a t-test
The biological comparison, direction and size of effect, uncertainty, test statistic, df, and p-value
One-way ANOVA null hypothesis
All population means are equal
F ratio
F = MS between / MS error; variation among group means compared with variation within groups
F when MS between = 15 and MS error = 3
F = 5
What a significant ANOVA F tells you
At least two means differ; it does not say which
Why use post-hoc tests with adjustment?
Unadjusted pairwise tests raise the risk of at least one false positive
Residual in one-way ANOVA
Observation minus its fitted group mean
Residual Q-Q plot is used to check
Approximate normality of residuals
Funnel shape in residuals vs. fitted values
Suggests unequal variance
Where do you assess independence?
From the experimental design
ANOVA alternatives when variances differ
Welch's one-way ANOVA (if residuals approx. normal), a justified transformation, or rank-based Kruskal-Wallis
Post-hoc: classical ANOVA, all pairwise
Tukey HSD
Post-hoc: each treatment vs. a control
Dunnett's comparisons
Post-hoc: after Welch's one-way ANOVA
Games-Howell
Post-hoc: after Kruskal-Wallis
Dunn's comparisons with multiplicity adjustment
Factorial ANOVA
Includes more than one factor
Interaction
One factor's effect depends on the level of another factor
Interaction before main effects
Graph and assess interactions before interpreting main effects
Balanced design
Equal counts in each factor combination
Without an interaction, Type II tests
Adjust each main effect for the other main effects
Interaction example: nutrients and temperature
Added nutrients improve growth when warm but have little effect when cool (non-parallel lines on an interaction plot)
Pearson r
Ranges from -1 to +1; measures linear direction and strength
Near-zero r
Can still occur with a nonlinear relationship
Simple linear regression equation
Predicted Y = intercept + slope x X
Slope
Change in predicted Y for a one-unit increase in X
Intercept
Predicted Y at X = 0 (check whether zero is within the sampled range)
R squared
Share of observed response variation accounted for by the model
Slope test
Commonly tests whether the population slope equals zero; a small p supports a nonzero slope under model assumptions
Residual in regression
Observed response minus fitted response
Regression assumptions to check
Linearity, independence, and residual variance
Influential observations
Investigate before deciding how to handle them
Interpolation vs. extrapolation
Interpolation predicts within the observed X range; extrapolation goes beyond the range where the relationship was checked
Prediction uncertainty and X
Generally increases farther from the center of sampled X values
Prediction interval vs. CI for the mean
Prediction interval (one new response) includes individual variability, so it is wider
Predicted biomass = 7 + 1.5 x light (h): prediction at 6 h
7 + 1.5(6) = 16 g
Interpret slope 1.5 in the biomass model
Predicted biomass increases 1.5 g for each additional hour of light
Interpret R squared = 0.36
The model accounts for 36% of the variation in observed biomass
Why prediction at 15 h is less defensible (data span 2-8 h)
Extrapolation beyond the sampled range; linearity unverified there
Why R squared, small slope p, and strong visual association don't prove causation
Causation depends on study design; confounding and other explanations can remain
Multiple regression
More than one predictor; interpret each coefficient conditional on the other predictors
Interaction in regression
A predictor's effect depends on another predictor
ANCOVA
Combines continuous predictors and categorical factors
Confounding
Can persist after adjustment for measured variables
Objects vs. functions in R
Objects store values; functions operate on them
R comments
Begin with #
x[3]
Selects the third element of vector x
data[row, column]
Selects entries by row and column; data[2, 3] is row 2, column 3
data$Height
Selects the Height column
str(data)
Checks column classes after importing
Storing measurements
As numeric values
Treatment labels
Convert to factors when appropriate
Packages in R
Install before loading with library()
Good script practice
Save an annotated script for importing and analysis; meaningful object names; document file paths
filter()
Selects rows
mutate()
Creates or changes columns
group_by()
Defines groups
summarize()
Creates group summaries
%>% (pipe)
Passes output to the next operation
pivot_longer() and pivot_wider()
Reshape data (wide to long and long to wide)
Data workflow order
Keep raw data, select rows, derive variables, summarize, check, and graph
aes()
Maps variables to visual properties such as color or shape
Geoms and facets
Geoms add marks; facets create panels for subsets
Comparing group distributions in a graph
Box plots with individual points
Continuous predictor vs. time sequence
Scatterplots for continuous predictors; line plots for meaningful time sequences
Graph labeling rules
Units, readable scales, distinguishable colors/shapes, and a label for uncertainty bars
Before interpreting fitted trends
Inspect raw observations first
Outlier
Can be a recording error or a valid extreme observation
What to check for an unusual observation
Original records, units, decimals, instrument notes, formulas, specimen IDs
Data quality red flags
Impossible values, unexpected missing codes, inconsistent category labels
A proportion outside 0-1
Check measurements and calculations
Documented errors and exclusions
Correct documented errors; document any exclusion and justify it independently of the effect on significance; report how influential valid observations affect results