11_ANOVA_2023

.pdf

School

McGill University *

*We aren’t endorsed by this school

Course

206

Subject

Biology

Date

Feb 20, 2024

Type

pdf

Pages

12

Uploaded by ConstableFlagBear38

Report
BIOL206 - Lab 11: ANOVA and population dynamics Fall 2023 Objectives The learning objectives of this lab are to: 1. Be introduced to population dynamics, an important element in ecology and conservation. 2. Compare the means of more than two groups using a statistical test called an ANOVA. Population dynamics Species extinctions are necessarily preceded by declines in abundance of plant and animal populations. Thus, many ecologists are interested in tracking population trends (i.e., whether abundance is increasing or decreasing), which can be done by repeatedly counting populations over time. This is known as “time-series data”. Population growth or decline can be described mathematically using the equation: N ( t + 1) = N ( t ) e r where N(t) is the population size at time t , N(t+1) is the population size at time t + 1 , and r is the growth rate. The units of r are t 1 . Obviously, this is a simplified model of population dynamics, as it does not include processes such as random population fluctuations and density dependence. Nonetheless, our main interest is on the coefficient r , which will determine whether the population is growing or declining over the long term. Estimating population growth from time series data We can rearrange the equation above to see how to estimate the growth rate, r , from time-series data: N ( t + 1) = N ( t ) e r N ( t + 1) /N ( t ) = e r 1
log ( N ( t + 1) /N ( t )) = r log ( N ( t + 1)) log ( N ( t )) = r Therefore, the difference in the log population size from one year to the next is an estimate of the population growth rate. This value is known as the log-difference. For example, suppose that the population size of a population has the following values over five years: Year t Population size N(t) Log of population size log(N(t)) Log-difference log(N(t+1))-log(N(t)) 2000 39 3.664 2001 61 4.111 4.111-3.664 = 0.447 2002 48 3.871 3.871-4.111 = -0.24 2003 31 3.434 3.434-3.871 = -0.437 2004 32 3.466 3.466-3.434 = 0.032 Notice that: If the population increases, the log-difference is positive. If the population stays almost the same, the log-difference is close to 0. If the population decreases, the log-difference is negative. The mean log-difference over the five year time period was -0.05 year 1 . This value is an estimate of the growth rate, r , of the population. In this lab and next week’s lab, we will try to predict population growth rate. The Living Planet Index In this lab, we use data sampled from The Living Planet Index database. From the LPI website in 2022: "The LPI tracks almost 21,000 populations of mammals, birds, fish, reptiles and amphibians around the world. [...] The data is gathered from almost 4,000 sources, using increasingly sophisticated technology such as audio devices to monitor insect sounds; drones and satellite tagging to track populations on the move; and even block-chain technology to track the impact of harvesting on wild populations." 2
Map of terrestrial & freshwater populations in the Living Planet Database. Analysis of Variance Today, we will use a statistical test called an ANOVA to try to predict population growth rate of animal populations in the Living Planet Database. So far, you have learned two types of hypothesis tests: t-tests and linear regressions. Today, you will learn a third type of hypothesis test: analysis of variance (ANOVA). To review: One-sample t-tests are used to determine whether a population mean is equal to a hypoth- esized value. Two-sample t-tests are used to determine whether two populations have the same mean. Linear regressions are used to determine whether two continuous variables are related. ANOVAs will add a new ability to your repertoire. Similar to a two-sample t-test but more flexible, ANOVAs allow you to determine whether two or more populations have the same mean. The statistical hypotheses associated with an ANOVA for k number of groups are: Null hypothesis ( H 0 ): The population mean is the same for all groups. µ 1 = µ 2 = ... = µ k Alternative hypothesis ( H A ): The population mean varies between the groups. 3
Note: We do not generally specify the alternative hypothesis in mathematical terms for an ANOVA with more than two groups. However, if we we want to write it out, we need to list all possible group differences. For example, for an ANOVA with three groups: H A : µ 1 ̸ = µ 2 or µ 1 ̸ = µ 3 or µ 2 ̸ = µ 3 . ANOVAs can test whether any number of groups have different population means. Therefore, it can test whether two groups have different population means, just like two-sample t-tests. In fact, two-sample t-tests and ANOVAs with two groups are mathematically related and can be used interchangeably in many situations. The F-statistic ANOVAs use F as a test statistic. Although the calculation and distribution of F is different from t, thehypothesistestingframeworkisthesame: Youcalculatetheteststatisticforyourobservations and compare it to a critical value to know whether to reject the null hypothesis. The formula for F is: F = MSG MSE Where MSG is the mean square between groups, a measure of variation between the groups. MSE is the mean square within groups, a measure of variation within groups. Sources of variation in ANOVA (modi ed from https://www.datanovia.com/en/lessons/anova-in-r/ ) Therefore, F is a ratio of variation between and within groups. The more variation there is between groups (relative to within groups), the larger the F. If F is large enough (i.e., greater than the critical value), we reject the null hypothesis that the groups have the same mean. 4
Procedure This week you will be using ANOVAs to predict growth rates of populations in the Living Planet Index database. We have already calculated the estimated growth rates for the populations for you, by taking the mean log-difference of the time series data. We will refer to the mean log-difference as “population growth rate”, although “estimated mean population growth rate” would be a more accurate (but cumbersome) name. There is one population growth rate value for each population. Start by downloading the Living Planet data, “LPI.csv”, from MyCourses. Open an R Script, set your working directory, and load the csv as a dataframe. Call it “LPI”. Each row is a different population. The final column of the dataframe is Pop.growth. This is the mean log-difference of each population. The other columns give other information about the populations, such as their class and biome. # Look at the LPI data View (LPI) Scientific question An interesting observation is that the average population growth of the populations is close to zero. In fact, a one-sample t-test shows that the mean population growth rate is not significantly different from zero. # One-sample t-test of population growth # H0: mu = 0 t.test (LPI $ Pop.growth, mu= 0 , alternative= "two.sided" ) This lack of change in average population size across all populations is the result of some popu- lations increasing and offsetting declines in other populations. Looking at a histogram of the population growth rates, we can see that the mean of the distribution is approximately zero, but there is symmetrical variation around the mean. # Install the ggplot2 package install.packages ( "ggplot2" ) # Load ggplot2 library (ggplot2) # Histogram of population growth ggplot ( data = LPI) + geom_histogram ( mapping = aes ( x = Pop.growth), bins = 10 ) + labs ( title = "Histogram of population growth rate" , x = "Populuation growth rate (1/year)" , y = "Frequency" ) What explains this variation? In other words, what predicts whether a population declines, in- creases, or stays the same over time? Populations do not grow or decline in isolation, but instead are affected by myriad potential factors that may vary across space and time. A better under- 5
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help