INFERENTIAL STATISTICS AND HYPOTHESIS
TESTING
Erik Kusch
erik.kusch@i-solution.de
Section for Ecoinformatics & Biodiversity
Center for Biodiversity and Dynamics in a Changing World (BIOCHANGE)
Aarhus University
Aarhus University Biostatistics - Why? What? How? 1 / 44
1 Background
Introduction
Methods Of Inferential Statistics
2 Hypotheses
What Are Hypotheses?
Types Of Hypotheses
3 Hypothesis Testing
Basic Workflow
Statistical Tests
Statistical Significance
4 Our Research Project
Majour Research Questions (Hypotheses)
Data Collection And Study Plan
Testing The Hypotheses
Aarhus University Biostatistics - Why? What? How? 2 / 44
Background Introduction
Introduction
Inferential statistics are used to draw conclusions from data.
The aim:
To formulate hypotheses and test these in order to be able to
make generalisations concerning populations from samples.
The procedure:
Using random sampling practices and hypotheses testing
procedures to judge validity of previously established
hypotheses.
Inferential statistics often invoke measures of statistical significance.
Aarhus University Biostatistics - Why? What? How? 4 / 44
Background Methods Of Inferential Statistics
Methods & Quirks
Information is handed to inferential statistics in a multitude of different forms
(e.g. vectors, matrices, data frames). This information is used to:
Establish Hypotheses:
Null/Alternative
(Non-)Directional
(Non-)Specified
Difference
Equivalence
Relationship
Test Hypotheses:
Non-Parametric Tests
Nominal and Correlation tests
Ordinal and Metric tests
...
Parametric Tests
t-test
ANOVA
...
Inferential statistics allow generalisation beyond the data at hand!
Aarhus University Biostatistics - Why? What? How? 5 / 44
Hypotheses What Are Hypotheses?
Hypotheses And Their Importance
What is a hypothesis?
In the case of inferential statistics, a hypothesis presents some rationale about
patterns within the natural world and hence the data.
What’s the fuss?
Hypotheses are simplifications of possible norms of natural processes and
make things testable.
So?
Getting the right answers always comes down to asking the right questions.
Hypotheses are, more or less, educated guesses.
Aarhus University Biostatistics - Why? What? How? 7 / 44
Hypotheses Types Of Hypotheses
Null vs. Alternative Hypotheses (Theory)
This is the most basic format of hypotheses upon which every other type of
hypothesis is built.
Null Hypothesis:
Represents a base assumption
(X = Y )
Can either be accepted or rejected
Alternative Hypothesis:
Represents the negation of the
null hypothesis (X 6= Y )
Will be accepted or rejected based
on whether the null hypothesis is
found to be correct or not
Usually, you will refer to every type of hypothesis in this context.
Aarhus University Biostatistics - Why? What? How? 8 / 44
Hypotheses Types Of Hypotheses
Null vs. Alternative Hypotheses (Example)
"Our null expectation, if climate niche
is expanding randomly or equally on all
niche peripheries, [...]. This would
result in an EI (Expansion Index) value
of 0."
Ralston, J. et al. (2016) ’Population trends influence species ability to
track climate change’, Global Change Biology, pp. 1-10. doi:
10.1111/gcb.13478.
"[...] detect vegetation cover [...]. Chi
squared test was applied to test the
null hypothesis of no effects. [...]
logistic regression model performs
better than the null model [...]"
Nioti, F. et al. (2015) ’A Remote Sensing and GIS Approach to Study
the Long-Term Vegetation Recovery of a Fire-Affected Pine Forest in
Southern Greece’, Remote Sensing, 7(6), pp. 7712-7731. doi:
10.3390/rs70607712.
Ralston, J. et al. (2016) ’Population trends influence species ability to track
climate change’, Global Change Biology, pp. 1-10. doi: 10.1111/gcb.13478.
Aarhus University Biostatistics - Why? What? How? 9 / 44
Hypotheses Types Of Hypotheses
Difference Hypotheses
This format of hypotheses is built upon postulated differences in variable
parameters within samples.
In Theory:
A difference in certain variable
parameters (see seminar 4)
between multiple samples is
postulated
X 6= Y
In Practice:
"[...] difference in the rate of treated
bleeding events [...] between [...]
prophylaxis (group A) and [...] no
prophylaxis (group B) [...]"
Oldenberg, J. et al. (2017) ’Emicizumab prophylaxis in hemophilia A
with inhibitors’, N.Engl.J Med., pp. 1-10. doi:
10.1056/NEJMoa1703068.
"[...] could enable the plant to react
differently to the next frost spell"
Walter, J. et al. (2013) ’Ecological stress memory and cross stress
tolerance in plants in the face of climate extremes’, Environmental
and Experimental Botany. Elsevier B.V., 94, pp. 3-8. doi:
10.1016/j.envexpbot.2012.02.009.
Aarhus University Biostatistics - Why? What? How? 10 / 44
Hypotheses Types Of Hypotheses
Equivalence Hypotheses
This format of hypotheses is built upon postulated equivalence of variable
parameters within samples.
In Theory:
An equivalence of certain variable
parameters (see seminar 4)
between multiple samples is
postulated
X Y
In Practice:
"Thresholds are equivalent to tipping
points [...]"
Angeler, D. G. and Allen, C. R. (2016) ’Quantifying Resilience’,
Applied Ecology, pp. 617-624. doi: 10.1111/1365-2664.12649.
"Just as LAI is the canopy equivalent
of leaf area, so
g
is the canopy
equivalent of the quantum yield."
Prince, S. D. and Goward, S. N. (1995) ’Global primary production: a
remote sensing approach’, Journal of Biogeography, pp. 815-835.
doi: Doi 10.2307/2845983.
Aarhus University Biostatistics - Why? What? How? 11 / 44
Hypotheses Types Of Hypotheses
Relationship Hypotheses
This format of hypotheses is built upon postulated relationships of variables
within a population.
In Theory:
A relationship of multiple variables
within a population is postulated
X Y
In Practice:
"[...] yield significant relationships
between GPP and tree diversity."
Nightingale, J. M. et al. (2008) ’PREDICTING TREE DIVERSITY
ACROSS THE UNITED STATES AS A FUNCTION OF MODELED
GROSS PRIMARY PRODUCTION’, Ecological Applications, 18(1),
p. 93. Available at: http://dx.doi.org/10.1890/07-0693.1.
"[...] test for a series of hypothetical
relationships (i.e., linear through to
threshold) between ecological
response variable and environment
[...]"
Seddon, A. et al. (2014) ’A quantitative framework for analysis of
regime shifts in a Galapagos coastal lagoon’, Ecology, 95(11), pp.
3046-3055. doi: 10.1890/13-1974.1.
Aarhus University Biostatistics - Why? What? How? 12 / 44
Hypotheses Types Of Hypotheses
Directional vs. Non-Directional Hypotheses (Theory)
This format of hypotheses is built on postulated connections and/or
differences of variables within samples.
Directional Hypothesis:
Statement about the direction
these connections or differences
are postulated to function along
X > Y ; X Y ; X < Y ; X Y
Non-Directional Hypothesis:
No statement about the direction
these connections or differences
are postulated to function along
X 6= Y with X ? Y
Aarhus University Biostatistics - Why? What? How? 13 / 44
Hypotheses Types Of Hypotheses
Directional vs. Non-Directional Hypotheses (Example)
"[...] a tenfold variation in
mineralization rates from sand dunes
to fertilized meadows (Ellenberg 1977)
was associated with a 12-fold increase
in ANPP (Poorter & de Jong 1999)
[...]"
Lavorel, S. and Garnier, E. (2002) ’Predicting changes in community
composition and ecosystem functioning from plant traits: revisiting
the Holy Grail’, Functional Ecology, 16(Essay Review), pp. 545-556.
doi: Doi 10.1046/J.1365-2435.2002.00664.X.
"Individual tropical trees show
incredibly strong and persistent
variation in long-term growth rates,
resulting in a fourfold variation in the
ages of similarly sized trees."
Brienen, R. J. W., Sch, J. and Zuidema, P. A. (2016) ’Tree Rings in
the Tropics: Insights into the Ecology and Climate Sensitivity of
Tropical Trees’, in Tropical Tree Physiology. doi:
10.1007/978-3-319-27422-5.
Lavorel, S. and Garnier, E. (2002) ’Predicting changes in community
composition and ecosystem functioning from plant traits: revisiting the Holy
Grail’, Functional Ecology, 16(Essay Review), pp. 545-556. doi: Doi
10.1046/J.1365-2435.2002.00664.X.
Aarhus University Biostatistics - Why? What? How? 14 / 44
Hypotheses Types Of Hypotheses
Specified vs. Non-Specified Hypotheses (Theory)
This format is built on postulated effect sizes of treatments/groupings in
experimental/observational set-up.
Specified Hypothesis:
Statement about an expected
effect size/intensity within a set of
response variables based upon a
set of predictor variables.
X = β Y with β being some
pre-defined coefficient
Non-Specified Hypothesis:
Statement about an expected
effect within a set of response
variables based upon a set of
predictor variables without a notion
of an effect size/intensity.
X = β Y with β being some
undefined coefficient
Aarhus University Biostatistics - Why? What? How? 15 / 44
Hypotheses Types Of Hypotheses
Specified vs. Non-Specified Hypotheses (Example)
"The effect size of diversity (natural log
response ratio; LRR) is based on the
comparison of high and low species
richness levels [...]"
De Boeck, H. J. et al. (2017) ’Patterns and drivers of
biodiversity-stability relationships under climate extremes’, Journal of
Ecology, (October), pp. 1-13. doi: 10.1111/1365-2745.12897.
"[...] a sample of 51 participants with a
withdrawal rate of 10% in the control
group would provide a power of more
than 95% at a two-sided significance
level of 0.05 to detect an effect size of
4/18 = 0.22 (null hypothesis: rate ratio
= 1)."
Oldenberg, J. et al. (2017) ’Emicizumab prophylaxis in hemophilia A
with inhibitors’, N.Engl.J Med., pp. 1-10. doi:
10.1056/NEJMoa1703068.
De Boeck, H. J. et al. (2017) ’Patterns and drivers of biodiversity-stability
relationships under climate extremes’, Journal of Ecology, (October), pp. 1-13.
doi: 10.1111/1365-2745.12897.
Aarhus University Biostatistics - Why? What? How? 16 / 44
Hypothesis Testing Basic Workflow
How To Go About Testing Hypotheses
This process is highly variable but can be broken down into the following
general, consecutive steps:
1 Establish a hypothesis (in terms of
Null and Alternative)
2 Plan study and collect data
3 Testing
Assumption check
Exploratory analyses (seminar 4)
Data visualisation (seminar 5)
Final analysis
4 Exporting results and final
plotting
Aarhus University Biostatistics - Why? What? How? 18 / 44
Hypothesis Testing Basic Workflow
Planning A Study And Collecting Data
Study design is part of many other
courses. A few personal tips:
Establish a schedule for your
project
Use journal(s) to record:
Weekly ToDo lists
Important talks with
supervisors/co-authors
Note down spontaneous ideas for
the project
Talk about it
When collecting data ensure that
Relevant standards and
standardised measuring
schemes are used (e.g.:
Pérez-Harguindeguy, N. et al. (2013) ’New
handbook for standardized measurement of
plant functional traits worldwide’, Australian
Journal of Botany, 61, pp. 167-234. doi:
http://dx.doi.org/10.1071/BT12225. for
plant functional traits)
Relevant details about data
collection make it to the final
manuscript
Aarhus University Biostatistics - Why? What? How? 19 / 44
Hypothesis Testing Basic Workflow
Sampling
Depending on how your project is structured, you will need to draw samples
from your data. The most common sampling practices are:
Random sampling:
Most commonly used
Applicable when true randomness
is desired
Use the sample() function in R (see
seminar 1)
Remember to make the
sampling reproducible!
Stratified sampling:
Applicable when
pseudo-randomness is desired
Population is divided into groups
(strata)
Random sampling is carried out
for each strata
Strata samples are combined
Use the stratified() function in R
or in-built functions of certain statistical
test functions
Aarhus University Biostatistics - Why? What? How? 20 / 44
Hypothesis Testing Basic Workflow
Assumptions
Statistical tests rely on individual statistical assumptions. Most prominent:
Normality: Data follow a normal
distribution (see seminar 3)
Randomness: Data are truly
random (see seminar 1)
Independence: Data are
independent
Homogeneity of variances: Data
from separate groups have same
variance
Linearity: Data have linear
relationship
Aarhus University Biostatistics - Why? What? How? 21 / 44
Hypothesis Testing Basic Workflow
Testing
General procedure:
1
Select appropriate test (this should
happen before data collection)
based on:
Data structure
Variable scale
Statistical assumptions
Applicability to the hypothesis
2 Choose an appropriate test
statistic (often pre-determined by
the choice of test)
3
Test statistical significance (usually
p-value)
Aarhus University Biostatistics - Why? What? How? 22 / 44
Hypothesis Testing Statistical Tests
Overview Of Tests
Tests come in a variety of forms. Too much to cover all of them in one seminar
series.
We will focus on a select few.
Tests can be classified according to their use of parameters:
Parametric Tests
More restrictive
Make strict assumptions
Easy to interpret
Require less data
Non-Parametric Tests
Less restrictive
Make little to no assumptions
Often a black box
Require more data
We will focus on the more basic tests of both categories.
Aarhus University Biostatistics - Why? What? How? 23 / 44
Hypothesis Testing Statistical Tests
Choosing The Appropriate Test I
The choice of test depends on:
The dependent variable(s)
( Response(s))
Scale/Distribution (Type)
Number
The independent
variable(s) ( Predictor(s))
Scale/Distribution (Type)
Number
The measure employed by
descriptive statistics which is
to be tested on (seminar 4)
Aarhus University Biostatistics - Why? What? How? 24 / 44
Hypothesis Testing Statistical Tests
Choosing The Appropriate Test II
Aarhus University Biostatistics - Why? What? How? 25 / 44
Hypothesis Testing Statistical Significance
The p-value: Abstraction, Distraction And Action I
The p-value is the measure of
statistical significance in
contemporary science!
A p-value below the significance
cut-off value (usually 0.05) indicates a
significant test metric
p-values are subject to a heated
debate (seminar 1) as everyone wants
significant results and the concept of
the p-value is often misunderstood
Aarhus University Biostatistics - Why? What? How? 26 / 44
Hypothesis Testing Statistical Significance
The p-value: Abstraction, Distraction And Action II
The common misconceptions:
"The p-value is the probability that the
null hypothesis is true"
"The p-value is the probability that the
observed effects were produced by
random chance alone."
"The p-value does indicate the size or
importance of the observed effect."
The right interpretation:
"The p-value is the probability of
randomly obtaining an effect at least
as extreme as the one in your sample
data, given the null hypothesis."
The 0.05 significance level is an
arbitrary convention!
Aarhus University Biostatistics - Why? What? How? 27 / 44
Hypothesis Testing Statistical Significance
Errors I
Uncertainty is an inherent property of any statistical method.
Statistical errors can be of:
Type I ("True Negative")
Type II ("False Positive")
Statistical errors are
impossible to avoid but we
can aim to make as few as
possible.
Optimise α and β cut-off values (there is a trade off between them)
Aarhus University Biostatistics - Why? What? How? 28 / 44
Hypothesis Testing Statistical Significance
Errors II
Aarhus University Biostatistics - Why? What? How? 29 / 44
Our Research Project
OUR RESEARCH PROJECT
Evolution of Passer domesticus in Response to Climate Change
Erik Kusch
erik.kusch@uni-leipzig.de
Section for Ecoinformatics & Biodiversity
Center for Biodiversity and Dynamics in a Changing World (BIOCHANGE)
Aarhus University
Aarhus University Biostatistics - Why? What? How? 31 / 44
Our Research Project
Motivation
Climate Change:
Increasingly warming
temperatures
Increasing frequency and intensity
of climate extremes
De Boeck, H. J. et al. Patterns and drivers of biodiversity-stability relationships
under climate extremes. J. Ecol. 1-13 (2017). doi:10.1111/1365-2745.12897
Understanding patterns of
evolution caused by climate
change is vital for mankind.
Biological Consequences:
Pole-ward range shifts of species
have been observed
Ralston, J. et al. Population trends influence species ability to track climate
change. Glob. Chang. Biol. 1-10 (2016). doi:10.1111/gcb.13478
Recent evolutionary processes can
be linked to climate change
Parmesan, C. Ecological and Evolutionary Responses to Recent Climate
Change. Annu. Rev. Ecol. Evol. Syst. 37, 637-669 (2006).
Mankind relies on ecosystem
services which may be affected by
climate change
Truchy, A. et al. Linking biodiversity, ecosystem functioning and services, and
ecological resilience: Towards an integrative framework for improved
management. Advances in Ecological Research 53, (Elsevier Ltd., 2015).
Aarhus University Biostatistics - Why? What? How? 32 / 44
Our Research Project
Studying Climate Change
Climate change is a temporal phenomenon
Usually studied through time-series based approaches
What if we don’t have time-series data?
We can trade time for space making use of the spatial aspect of
climate change
Warming Effects:
The spatial equivalent to temporal
warming effects of climate change
manifests on latitudinal
gradients. Equatorward
placement of organisms imposes a
warming effect.
Climate Extremes:
The spatial equivalent to temporal
changes in frequency and intensity
of climate extremes can be
expressed via continental
(extreme) and coastal (moderate)
climate patterns
Aarhus University Biostatistics - Why? What? How? 33 / 44
Our Research Project
Studying Evolution
Evolution is an inherently temporal as well as spatial phenomenon
Studied through time-series based approaches, phylogenies, etc.
Temporal Aspects:
What if we don’t have time-series
data at one location?
We can trade
time
for
space
as
long as there are gradients
representing evolutionary forcing
Latitudinal and longitudinal
gradients can be regarded as
representative of glimpses into
future or past environmental
conditions of species.
Spatial Aspects:
Evolution relies on the separation
of populations for differences to
arise (divergent evolution)
We need to select populations
that are in no feasible
reproductive contact
Invasive vs. Non-Invasive
Populations can be used to draw
conclusions about divergent
evolutionary patterns
Aarhus University Biostatistics - Why? What? How? 34 / 44
Our Research Project
Our Study Organism
Passer domesticus - The Common House Sparrow
Present globally
Lends itself to gradient-based
approaches
Non-migratory & Invasive species
in some parts of the world
Studies of divergent evolution
are possible
Well-researched
Comparative analyses are
possible
Aarhus University Biostatistics - Why? What? How? 35 / 44
Our Research Project Majour Research Questions (Hypotheses)
Warming Effects
Equatoward location driven warming effects alter the size and bodyweight of
individual sparrows.
Variables
Weight:
Weight is a reliable indicator of how much resources have been
amassed by an individual sparrow.
Height:
Height influences exposure to surrounding temperatures through
stature and surface area thus indicating heat loss potential of an
individual sparrow.
Wing Span:
Wing span is the horizontal analogue to height measurements and
can be indicative of heat loss potential of individual sparrows.
According to Bergmann’s rule, organisms of the same species tend to grow bigger and heavier in
colder climates since larger animals have a lower surface area to volume ratio thus radiating less
body heat per unit of mass and conserving energy.
Aarhus University Biostatistics - Why? What? How? 36 / 44
Our Research Project Majour Research Questions (Hypotheses)
Climate Extremes
Sparrows residing in areas characterised by extreme climate events will differ
from sparrows in more stable environments.
Variables
Weight:
Weight of individual sparrows is representative of energy
resources.
Population
Size:
Population size is an important factor of carrying capacity of
habitats.
No. Eggs: Number of eggs reflects investment in offspring.
Egg Weight:
Weight of individual eggs is representative of investment in
individual offspring.
We expect sparrows in more extreme climatic conditions to have stored vast amounts of energy
whilst the habitats themselves exhibit lower carrying capacities.
Aarhus University Biostatistics - Why? What? How? 37 / 44
Our Research Project Majour Research Questions (Hypotheses)
Competition
Competition is more pronounced in certain areas leading to changes in sparrow
physiology and behaviour.
Variables
Flock Size:
Flock size is an indicator of the rate of resource depletion and
resource availability.
Home Range:
Home range is a measure of how far an individual will fly to
forage.
Weight:
Individual weight is a measure of how well an individual does in
competing for food.
Sex:
Differences in fitness due to competition may be a result of
sexual differences.
We expect sparrows in less hospitable habitats to group in smaller flocks with bigger home ranges.
Aarhus University Biostatistics - Why? What? How? 38 / 44
Our Research Project Majour Research Questions (Hypotheses)
Predation
Presence and type of predator will influence sparrow behaviour and physiology.
Variables
Predator Presence: Indicating whether a predator is present.
Predator Type: Indicating the kind of predator that is present.
Nesting Site: Where a sparrow nest is located.
Nesting Height: How height the nesting site is from the ground.
Colour: Colour is one of the main factors to conspicuousness.
Flock Size:
Flock size is one of the main factors to
conspicuousness.
We expect sparrows which are under pressure from predation to nest differently than ones which
are not.
Aarhus University Biostatistics - Why? What? How? 39 / 44
Our Research Project Majour Research Questions (Hypotheses)
Sexual Dimorphism
Sexual dimorphism is less/more pronounced in invasive or non-invasive
species.
Variables
Weight:
Differences in weight of individuals of different sexes are key to
uncovering sexual dimorphism.
Colour:
Displays of colour greatly influence competition for mates which
is often subject to a structure of sexual dimorphism.
We expect sexual dimorphism to be more pronounced in invasive populations of sparrows as these
are located in environments which are much less hostile to them due to an initial lack of predators
and thus increased fitness (and ability to invest in sexually dimorphic displays).
Aarhus University Biostatistics - Why? What? How? 40 / 44
Our Research Project Data Collection And Study Plan
Study Setup I
Set-up of 11 Sites chosen according to three factors/treatments (latitude,
climate and population status):
Site Index Lat [
] Lon [
] Climate Population Status
Siberia SI 60 100 Continental Native
United Kingdom UK 54 -2 Coastal Native
Australia AU -25 135 Continental Introduced
Reunion RE -21.1 55.6 Coastal Introduced
Nunavut NU 70 -90 Coastal Introduced
Manitoba MA 55 -97 Semi-Coastal Introduced
Louisiana LO 31 -92 Coastal Introduced
Belize BE 17.25 -88.75 Coastal Introduced
French Guiana FG 4 -53 Coastal Introduced
South America SA -14.6 -57.7 Coastal Introduced
Falkland Isles FI -51.75 -59.17 Coastal Introduced
Source: https://www.cabi.org/isc/datasheet/38975, retrieved 21/01/2018
We also resettle the population of SI to MA and UK
Aarhus University Biostatistics - Why? What? How? 41 / 44
Our Research Project Data Collection And Study Plan
Study Setup II
We have three data files. Check the README file for a data description.
Aarhus University Biostatistics - Why? What? How? 42 / 44
Our Research Project Testing The Hypotheses
Using Our Data I
ATTENTION!
All the data we will use is simulated!
Data Management and data cleaning will be done throughout seminar 7 (Data
Handling and Data Mining).
The actual analyses will be done in the following seminars (8-12) using these
statistical approaches:
Nominal Tests (Seminar 8)
Binomial
McNemar
Cochqran’s Q
Chi
2
Correlation Tests (Seminar 9)
Pearson
Rank
Spearman
Kendall’s Tau
Aarhus University Biostatistics - Why? What? How? 43 / 44
Our Research Project Testing The Hypotheses
Using Our Data II
Analyses covered in this seminar series (continued):
Ordinal/Metric tests for two-sample
situations (Seminar 10)
Mann-Whitney U
Wilcoxon signed-rank test
Ordinal/Metric tests for more than
two-sample situations (Seminar 11)
Kruskal-Wallis H test
Friedman test
Parametric Tests (Seminar 12)
t-test
ANOVA
(M)AN(C)OVA
Some advanced statistical methods
will be touched on in seminar 13
(Summary, Manuscript Workflow
and an Outlook on Advanced
Statistics)
A finalised script (of R code) will be produced in seminar 13 (Summary,
Manuscript Workflow and an Outlook on Advanced Statistics)
Aarhus University Biostatistics - Why? What? How? 44 / 44