25
Choosing and using Choosing and using statistics to test statistics to test ecological ecological hypotheses hypotheses Botany 332 Lab Tutorial Botany 332 Lab Tutorial Department of Biological Department of Biological Sciences Sciences University of Alberta University of Alberta November 2004 November 2004

Choosing and using statistics to test ecological hypotheses Botany 332 Lab Tutorial Department of Biological Sciences University of Alberta November 2004

Embed Size (px)

Citation preview

Page 1: Choosing and using statistics to test ecological hypotheses Botany 332 Lab Tutorial Department of Biological Sciences University of Alberta November 2004

Choosing and using Choosing and using statistics to test statistics to test

ecological hypothesesecological hypothesesBotany 332 Lab TutorialBotany 332 Lab Tutorial

Department of Biological SciencesDepartment of Biological SciencesUniversity of AlbertaUniversity of Alberta

November 2004November 2004

Page 2: Choosing and using statistics to test ecological hypotheses Botany 332 Lab Tutorial Department of Biological Sciences University of Alberta November 2004

EXPERIMENTCritical test of null hypothesis

NULL HYPOTHESISLogical opposite to hypothesis

OBSERVATIONSPatterns in space or time

HYPOTHESISPredictions based on model

MODELSExplanations or theories

INTERPRETATION

Retain Ho (Null Hypothesis)

Refute hypothesis and model

Reject Ho (Null Hypothesis)

Support hypothesis and

model

Underwood (1997)

Page 3: Choosing and using statistics to test ecological hypotheses Botany 332 Lab Tutorial Department of Biological Sciences University of Alberta November 2004

Ecological experimentsEcological experiments

1.1. OBSERVE things.OBSERVE things.2.2. Come up with MODELS (explanations or Come up with MODELS (explanations or

theories) to explain your observations.theories) to explain your observations.3.3. Based on your model, come up with a testable Based on your model, come up with a testable

HYPOTHESIS (and a NULL hypothesis).HYPOTHESIS (and a NULL hypothesis).4.4. Design an EXPERIMENT to test your null Design an EXPERIMENT to test your null

hypothesis statistically.hypothesis statistically.5.5. Conduct the experiment and collect DATA.Conduct the experiment and collect DATA.6.6. Use STATISTICS with your data to TEST the null Use STATISTICS with your data to TEST the null

hypothesis.hypothesis.7.7. INTERPRET your results. Did you accept or INTERPRET your results. Did you accept or

reject the null hypothesis?reject the null hypothesis?8.8. Repeat!Repeat!

Page 4: Choosing and using statistics to test ecological hypotheses Botany 332 Lab Tutorial Department of Biological Sciences University of Alberta November 2004

Testing (null) hypotheses Testing (null) hypotheses statisticallystatistically

Recall we can’t prove our hypothesis, Recall we can’t prove our hypothesis, so we try to so we try to disdisprove a null prove a null hypothesis instead!hypothesis instead!

Null hypothesis = opposite of our Null hypothesis = opposite of our actual hypothesisactual hypothesis– HH00 = Null Hypothesis = Null Hypothesis

– HHAA = Alternative hypothesis = Alternative hypothesis

Page 5: Choosing and using statistics to test ecological hypotheses Botany 332 Lab Tutorial Department of Biological Sciences University of Alberta November 2004

Testing (null) hypotheses Testing (null) hypotheses statisticallystatistically

We formally test hypotheses using statistics

Which statistical test to use? Depends on your experimental design, data and your hypotheses

It’s important to understand the basics of statistical hypothesis testing

Page 6: Choosing and using statistics to test ecological hypotheses Botany 332 Lab Tutorial Department of Biological Sciences University of Alberta November 2004

Testing (null) hypotheses Testing (null) hypotheses statisticallystatistically

Based on assumptions about the data, Based on assumptions about the data, statistics tell us the probability that the null statistics tell us the probability that the null hypothesis is true (P-value).hypothesis is true (P-value).

If P is small enough, we can reject the null If P is small enough, we can reject the null hypothesis (result is “statistically hypothesis (result is “statistically significant”).significant”).

What’s “small enough”?What’s “small enough”?– P < 0.05P < 0.05

Reject null hypothesis (accept our hypothesis)Reject null hypothesis (accept our hypothesis)

– P > 0.05P > 0.05 Accept null hypothesis (reject our hypothesis)Accept null hypothesis (reject our hypothesis)

Page 7: Choosing and using statistics to test ecological hypotheses Botany 332 Lab Tutorial Department of Biological Sciences University of Alberta November 2004

Testing (null) hypotheses Testing (null) hypotheses statisticallystatistically

Many statistical methods also tell us the Many statistical methods also tell us the effect size or proportion of variation in the effect size or proportion of variation in the independent variable explained by the independent variable explained by the dependent variable.dependent variable.

e.g. Regression and correlatione.g. Regression and correlation– P-valuesP-values

HH00 = No relationship between variables = No relationship between variables

HHAA = Relationship between variables = Relationship between variables

– RR22 (variation explained) (variation explained)– Can have significant P-values but very small RCan have significant P-values but very small R22

Page 8: Choosing and using statistics to test ecological hypotheses Botany 332 Lab Tutorial Department of Biological Sciences University of Alberta November 2004

Choosing and using Choosing and using statisticsstatistics

Determine what kinds of data you Determine what kinds of data you havehave

Describe your dataDescribe your data Choose an appropriate statistical testChoose an appropriate statistical test Perform the testPerform the test Report and interpret the resultsReport and interpret the results

Page 9: Choosing and using statistics to test ecological hypotheses Botany 332 Lab Tutorial Department of Biological Sciences University of Alberta November 2004

What kinds of data do you What kinds of data do you have?have?

CategoricalCategorical– Fertilizer addition, species identityFertilizer addition, species identity

Continuous and discreteContinuous and discrete– Biomass, height, number of bitesBiomass, height, number of bites

Independent and Dependent Independent and Dependent variablesvariables

Page 10: Choosing and using statistics to test ecological hypotheses Botany 332 Lab Tutorial Department of Biological Sciences University of Alberta November 2004

Describe your dataDescribe your data

Measures of central tendencyMeasures of central tendency– Mean, medianMean, median

Measures of dispersionMeasures of dispersion– Variance, standard deviation, standard Variance, standard deviation, standard

error, range, quartileserror, range, quartiles

Page 11: Choosing and using statistics to test ecological hypotheses Botany 332 Lab Tutorial Department of Biological Sciences University of Alberta November 2004

Mean # of seeds/pod

13.0

12.0

11.0

10.0

9.0

8.0

7.0

6.0

5.0

4.0

3.0

2.0

1.0

In

Fre

quen

cy

8

6

4

2

0

Descriptive Statistics – Visual Descriptive Statistics – Visual AidsAids

BoxplotsBoxplots- median, upper and lower - median, upper and lower

quartiles, whiskers (fences), quartiles, whiskers (fences), outliersoutliers

HistogramsHistograms- separate, stackbar, or paired- separate, stackbar, or paired

Error Bar PlotsError Bar Plots

3744N =

Treatment

InOut

Me

an

# o

f se

ed

s/p

od

30

20

10

0

-10

54

Mean # of seeds/pod

26.0

24.0

22.0

20.0

18.0

16.0

14.0

12.0

10.0

8.0

6.0

4.0

2.0

0.0

Out

Fre

quen

cy

7

6

5

4

3

2

1

0

4437N =

Treatment

OUTIN

Mea

n #

of s

eeds

/pod

16

14

12

10

8

6

42

Page 12: Choosing and using statistics to test ecological hypotheses Botany 332 Lab Tutorial Department of Biological Sciences University of Alberta November 2004

Describe your dataDescribe your data

Normal vs. non-normal distributionsNormal vs. non-normal distributions– histograms, Q-Q plots, K-S test histograms, Q-Q plots, K-S test

(significant means non-normal)(significant means non-normal)

Page 13: Choosing and using statistics to test ecological hypotheses Botany 332 Lab Tutorial Department of Biological Sciences University of Alberta November 2004

Data transformationData transformation If your data are non-normalIf your data are non-normal

– Use non-parametric statisticsUse non-parametric statistics– Transform your dataTransform your data

square-root transformsquare-root transform log transformlog transform

Page 14: Choosing and using statistics to test ecological hypotheses Botany 332 Lab Tutorial Department of Biological Sciences University of Alberta November 2004

Choose your statistical testChoose your statistical test

Choose statistical tests based on Choose statistical tests based on your hypothesis, experimental design your hypothesis, experimental design and the data you have collectedand the data you have collected

Parametric tests assume data are Parametric tests assume data are normal, non-parametric tests do notnormal, non-parametric tests do not

Many textbooks have recipes or Many textbooks have recipes or flowcharts for choosing statisticsflowcharts for choosing statistics

Check with your TA’sCheck with your TA’s

Page 15: Choosing and using statistics to test ecological hypotheses Botany 332 Lab Tutorial Department of Biological Sciences University of Alberta November 2004

Common statistical testsCommon statistical tests

Chi-squared testChi-squared test t-test (Mann-Whitney U test)t-test (Mann-Whitney U test) One-way ANOVA (Kruskal-Wallis test)One-way ANOVA (Kruskal-Wallis test) Two-way ANOVATwo-way ANOVA ANCOVAANCOVA

– ANOVA with covariateANOVA with covariate Correlation and regressionCorrelation and regression

Page 16: Choosing and using statistics to test ecological hypotheses Botany 332 Lab Tutorial Department of Biological Sciences University of Alberta November 2004

Chi-squared testChi-squared test

For analysis of tables of counts or For analysis of tables of counts or frequenciesfrequencies

Good with categorical variablesGood with categorical variables Non-parametricNon-parametric

# plants# plants GerminatedGerminated Not Not GerminatedGerminated

OutcrossedOutcrossed 1414 1010

InbredInbred 66 1010

Page 17: Choosing and using statistics to test ecological hypotheses Botany 332 Lab Tutorial Department of Biological Sciences University of Alberta November 2004

t-testt-test

For analysis of categorical For analysis of categorical independent variable (2 categories) independent variable (2 categories) and a continuous dependent variableand a continuous dependent variable

Samples may be paired Samples may be paired (measurements on same individual) or (measurements on same individual) or independent (measurements on two independent (measurements on two sets of individuals)sets of individuals)

Assumes data are parametricAssumes data are parametric (non-parametric – Mann-Whitney U)(non-parametric – Mann-Whitney U)

Page 18: Choosing and using statistics to test ecological hypotheses Botany 332 Lab Tutorial Department of Biological Sciences University of Alberta November 2004

ANOVAANOVA

Analysis of Variance examines Analysis of Variance examines variation within and between groupsvariation within and between groups

For analysis of categorical For analysis of categorical independent variables (2 or more independent variables (2 or more categories) and a continuous categories) and a continuous dependent variabledependent variable

Assumes data are parametricAssumes data are parametric (non-parametric – Kruskal-Wallis)(non-parametric – Kruskal-Wallis)

Page 19: Choosing and using statistics to test ecological hypotheses Botany 332 Lab Tutorial Department of Biological Sciences University of Alberta November 2004

ANOVAANOVA

One-way ANOVAOne-way ANOVA– Single independent variableSingle independent variable– Main effectMain effect

Two-way ANOVATwo-way ANOVA– Two independent variablesTwo independent variables– Main effects and interaction termsMain effects and interaction terms

Significant result means at least one group Significant result means at least one group differed from anotherdiffered from another

Use Use post-hoc testspost-hoc tests to test for differences to test for differences among individual treatmentsamong individual treatments

Page 20: Choosing and using statistics to test ecological hypotheses Botany 332 Lab Tutorial Department of Biological Sciences University of Alberta November 2004

ANCOVAANCOVA

Analysis of CovarianceAnalysis of Covariance For analysis of categorical For analysis of categorical

independent variables (2 or more independent variables (2 or more categories), a continuous dependent categories), a continuous dependent variable, and a covariatevariable, and a covariate

Effects of covariate removed before Effects of covariate removed before testing for effect of independent testing for effect of independent variable(s)variable(s)

Page 21: Choosing and using statistics to test ecological hypotheses Botany 332 Lab Tutorial Department of Biological Sciences University of Alberta November 2004

Correlation and regressionCorrelation and regression

Tests for relationships between Tests for relationships between two (or more) continuous variablestwo (or more) continuous variables

Important to consider both Important to consider both significance (P-value) and effect significance (P-value) and effect size (Rsize (R22))

Page 22: Choosing and using statistics to test ecological hypotheses Botany 332 Lab Tutorial Department of Biological Sciences University of Alberta November 2004

Report statistical resultsReport statistical results

What’s important?What’s important?– Test used and assumptions testedTest used and assumptions tested– Test statistic (t, F, RTest statistic (t, F, R22, , χχ22, etc.), etc.)– Significance (P-value)Significance (P-value)– Sample size / degrees of freedomSample size / degrees of freedom

How to report results?How to report results?– TextText– FiguresFigures– TablesTables

Page 23: Choosing and using statistics to test ecological hypotheses Botany 332 Lab Tutorial Department of Biological Sciences University of Alberta November 2004

3946N =

Treatment

OUTIN

Nu

mF

low

ers

140

120

100

80

60

40

20

0

-20

13

ANOVA, F = 1.8, df = 1,83

P = 0.17

Nu

mb

er

of

flow

ers

per

pla

nt

Page 24: Choosing and using statistics to test ecological hypotheses Botany 332 Lab Tutorial Department of Biological Sciences University of Alberta November 2004

Interpret your resultsInterpret your results

Remember to relate results/tests to Remember to relate results/tests to your original hypothesesyour original hypotheses

Correlation ≠ causationCorrelation ≠ causation (P > 0.05) ≠ bad(P > 0.05) ≠ bad Recognize trends even when not Recognize trends even when not

statistically significantstatistically significant Talk to your TAs if you have any Talk to your TAs if you have any

questionsquestions

Page 25: Choosing and using statistics to test ecological hypotheses Botany 332 Lab Tutorial Department of Biological Sciences University of Alberta November 2004

SPSS walkthroughSPSS walkthrough

Data entry and transformationData entry and transformation Descriptive statisticsDescriptive statistics Creating figuresCreating figures AnalysesAnalyses

– Chi-square (inbreeding data)Chi-square (inbreeding data)– t-test / ANOVA (inbreeding data)t-test / ANOVA (inbreeding data)– ANCOVA (tomato data)ANCOVA (tomato data)– Correlation and regression (inbreeding Correlation and regression (inbreeding

data)data)