⌘+C
## If you did not install modeldata and tidyverse packages, execute following codes:
install.packages("modeldata")
install.packages("tidyverse")
Experimental design in Education
Jihong Zhang*, Ph.D
Educational Statistics and Research Methods (ESRM) Program*
University of Arkansas
August 18, 2025
Context:
Data were collected for two species: O. exclamationis and O. niveus. The data are contained in a data frame called crickets
with a total of 31 data points.
Study on cricket chirp rates and temperature for two species
Data:
Temperature (°C)
Chirps per minute
Species: (A) O. exclamationis (B) O. niveus
Motivation:
Research Questions:
RQ1: Does temperature affect chirp rate in general?
RQ2: Do species differ in their chirp rates?
RQ3: Do species respond differently to temperature?
Null Hypotheses:
Null Hypotheses for hypothesis testing:
1. H₀: Temperature has no effect (β_{temp} = 0)
2. H₀: No species difference (β_{species} = 0)
3. H₀: No interaction (β_{temp×species} = 0)
Analysis of Variance Table
Model 1: rate ~ temp + species
Model 2: rate ~ (temp + species)^2
Res.Df RSS Df Sum of Sq F Pr(>F)
1 28 89.350
2 27 85.074 1 4.2758 1.357 0.2542
Result: Interaction not significant (p > 0.05). Choose simpler model without interaction
Call:
lm(formula = rate ~ temp + species, data = crickets)
Residuals:
Min 1Q Median 3Q Max
-3.0128 -1.1296 -0.3912 0.9650 3.7800
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -7.21091 2.55094 -2.827 0.00858 **
temp 3.60275 0.09729 37.032 < 2e-16 ***
speciesO. niveus -10.06529 0.73526 -13.689 6.27e-14 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.786 on 28 degrees of freedom
Multiple R-squared: 0.9896, Adjusted R-squared: 0.9888
F-statistic: 1331 on 2 and 28 DF, p-value: < 2.2e-16
Interpretation:
Temperature effect: +3.75 chirps/°C (p < 0.001)
O. niveus: 17 fewer chirps/minute (p < 0.001)
Statistical Evidence:
1. Strong temperature effect (p < 0.001)
2. Clear species difference (p < 0.001)
3. Similar temperature response (no interaction)
Limitations:
Valid within observed temperature range (15-32°C)
Only two species studied
Here are the key steps for performing inferential statistics using the cricket example:
lm()
with interaction terms between temperature and speciesrate ~ (temp + species)^2