Treatment Control
1 18 49
2 74 100
3 65 47
4 24 71
5 25 89
Covered
Today we’ll cover: Chapter 1 in Whitlock and Schluter
Lamberti and Resh 1983
Common scientific questions:
What sort of experiment is this design and what are the issues with this?
https://ars.els-cdn.com/content/image/1-s2.0-S0272771416307958-fx1_lrg.jpg
Example: Spider and lizard populations on small islands
Hypothesis: On small islands, lizard predation controls spider density
We’re interested in causality. How do we get there?
Potential Problems:
Good design: Stronger inference from natural experiments
Experimenter directly manipulates predictor variable and measures response
Randomized, controlled trials: gold standard
Challenges:
Main problem of study design & interpretation: confounding varaibles
Good study design seeks to eliminate confounding through:
Replication is important because:
Without appropriate replication: Is the difference due to manipulation or something else?
Replication must be on the appropriate scale: match scale of replication to population of interest, otherwise run into pseudoreplication (Hurlbert 1984 - Pseudoreplication and the Design of Ecological Field Experiments)
When you pseudoreplicate, you:
Replicates must be on scale appropriate to population (& hypothesis!) of interest:
Example: Effect of temperature on phytoplankton growth
Possible solutions:
Controls help address this question:
Examples:
Activity 4: Designing Controls for Pine Experiments
Work in small groups to design appropriate controls for each experiment:
For each experiment, identify:
Independence of observations: assumption of many statistical methods
Events are independent if occurrence of one has no effect on occurrence of another
Temporal/spatial autocorrelation: violation of independence
Randomization helps deconfound “lurking” variables:
Random sampling from population:
Allocation of experimental units to treatment/control:
Randomization is essential at two levels:
Treatment Control
1 18 49
2 74 100
3 65 47
4 24 71
5 25 89
Activity 5: Field Sampling Pine Trees
Let’s consider sampling pine needles across campus:
Using power analysis to plan experiments:
Sample size calculation: how many samples will be needed?
Need to know: desired power, variability, significance level, effect size
Effect size calculation: what kind of effect can we find, given particular design?
Need to know: desired power, variability, significance level, n
Cohen’s d - standardized measure of effect size used in statistical analysis, particularly when comparing two means
Helps determine the practical significance of research findings, as opposed to just statistical significance (p-values). A Cohen’s d of 0.8 means that the difference between groups is large enough to be substantial in practical terms - specifically, it indicates that the means differ by 0.8 standard deviations.
How many samples do you need to find this difference
# A priori power analysis for t-test
# How many samples needed per group?
# Parameters
effect_size <- 0.8 # Cohen's d
significance <- 0.05
desired_power <- 0.8
# Calculate sample size needed
pwr.t.test(d = effect_size,
sig.level = significance,
power = desired_power,
type = "two.sample")
Two-sample t test power calculation
n = 25.52458
d = 0.8
sig.level = 0.05
power = 0.8
alternative = two.sided
NOTE: n is number in *each* group
# Post hoc power analysis
# If we had n = 20 per group
# Parameters
effect_size <- 0.5 # Medium effect size
significance <- 0.05
sample_size <- 20 # per group
# Calculate achieved power
pwr.t.test(n = sample_size,
d = effect_size,
sig.level = 0.05,
type = "two.sample")
Two-sample t test power calculation
n = 20
d = 0.5
sig.level = 0.05
power = 0.337939
alternative = two.sided
NOTE: n is number in *each* group
Activity 6: Power Analysis for Pine Needle Experiment
Let’s design a study to compare needle lengths between exposed and sheltered pine trees:
# Based on pilot data, we have these estimates:
exposed_mean <- 75 # mm
sheltered_mean <- 85 # mm
pooled_sd <- 12 # mm
# Calculate Cohen's d effect size
effect_size <- abs(exposed_mean - sheltered_mean) / pooled_sd
effect_size
[1] 0.8333333
# A priori power analysis
pwr.t.test(d = effect_size,
sig.level = 0.05,
power = 0.8,
type = "two.sample")
Two-sample t test power calculation
n = 23.60467
d = 0.8333333
sig.level = 0.05
power = 0.8
alternative = two.sided
NOTE: n is number in *each* group
Activity 6: Power Analysis for Pine Needle Experiment
Let’s design a study to compare needle lengths between exposed and sheltered pine trees:
Questions:
Key concepts we covered today:
Remember: