How to calculate the total proportional change in abundance based on GLMM predicted values in R?

58 Views Asked by At

I am now dealing with the analysis of a long term bird survey, that was conducted every 3 years since 2004. For each species, I used lme4 package to fit a GLMM with the abundance as the response variable, year and sampling effort as the predictos and transect as the random effect:

model <-  glmer(Sum_Abundance ~ Year + Sampling.Effort + (1|Transect), family = poisson, data = nestingbirds)

Next, i want to use metrics of proportional loss (i.e., percent decline) to facilitate comparison of population trends across species - I want to calculate the total proportional change in abundance (i.e., the change in the population integrated over the entire study period).The aim is to estimate how much a population changed in abundance since the study began.

For each species, I want to extract the slope associated with year (i.e. predicted number of unique individuals observed per year), and use the predicted values from the model to charachterize if the trend is increasing, decreasing, or has no change. In addition, I want to know if the trends are significant or not.

Does someone have the idea what is the code for this proccess in R?

Here is the data frame for the model:

structure(list(Year = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
4L, 4L, 4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 6L, 
6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 7L, 7L, 7L, 7L, 7L, 
7L, 7L, 7L, 7L, 7L, 7L, 7L), levels = c("2004", "2007", "2010", 
"2013", "2017", "2020", "2023"), class = "factor"), Transect = c("East", 
"East", "East", "North", "North", "North", "West", "West", "West", 
"East", "East", "East", "East", "North", "North", "North", "North", 
"West", "West", "West", "West", "East", "East", "East", "North", 
"North", "North", "West", "West", "West", "East", "East", "East", 
"East", "North", "North", "North", "North", "West", "West", "West", 
"West", "East", "East", "East", "East", "North", "North", "North", 
"North", "West", "West", "West", "West", "East", "East", "East", 
"East", "North", "North", "North", "North", "West", "West", "West", 
"West", "East", "East", "East", "East", "North", "North", "North", 
"North", "West", "West", "West", "West"), Repetition = c(1L, 
2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 4L, 1L, 2L, 3L, 4L, 
1L, 2L, 3L, 4L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 
4L, 1L, 2L, 3L, 4L, 1L, 2L, 3L, 4L, 1L, 2L, 3L, 4L, 1L, 2L, 3L, 
4L, 1L, 2L, 3L, 4L, 1L, 2L, 3L, 4L, 1L, 2L, 3L, 4L, 1L, 2L, 3L, 
4L, 1L, 2L, 3L, 4L, 1L, 2L, 3L, 4L, 1L, 2L, 3L, 4L), Sum_Abundance = c(15L, 
25L, 7L, 10L, 17L, 15L, 12L, 9L, 13L, 6L, 7L, 12L, 7L, 4L, 7L, 
7L, 3L, 2L, 4L, 3L, 2L, 15L, 21L, 21L, 20L, 19L, 18L, 9L, 12L, 
7L, 14L, 10L, 7L, 5L, 10L, 10L, 11L, 9L, 7L, 6L, 9L, 5L, 12L, 
11L, 17L, 11L, 4L, 5L, 15L, 12L, 5L, 5L, 5L, 3L, 14L, 13L, 13L, 
13L, 4L, 11L, 8L, 11L, 5L, 11L, 14L, 18L, 18L, 22L, 21L, 24L, 
6L, 7L, 9L, 14L, 13L, 13L, 21L, 17L), Date = c("31/05/2004", 
"08/06/2004", "09/07/2004", "28/05/2004", "10/06/2004", "11/07/2004", 
"01/06/2004", "04/06/2004", "15/06/2004", "22/04/2007", "30/04/2007", 
"22/05/2007", "18/06/2007", "27/03/2007 1:00", "17/04/2007", 
"06/05/2007", "10/06/2007", "28/03/2007 1:00", "19/04/2007", 
"20/05/2007", "11/06/2007", "26/03/2010 1:00", "30/04/2010", 
"21/05/2010", "25/03/2010 1:00", "16/04/2010", "24/05/2010", 
"28/03/2010", "18/04/2010", "23/05/2010", "13/03/2013 1:00", 
"13/04/2013", "15/05/2013", "15/06/2013", "15/03/2013 1:00", 
"15/04/2013", "14/05/2013", "16/06/2013", "12/03/2013 1:00", 
"14/04/2013", "16/05/2013", "18/06/2013", "23/03/2017 4:50", 
"23/04/2017 3:43", "28/05/2017 3:06", "22/06/2017 2:26", "26/03/2017 4:05", 
"22/04/2017 4:05", "29/05/2017 3:10", "21/06/2017 3:06", "27/03/2017 3:18", 
"24/04/2017 3:32", "25/05/2017 4:26", "29/06/2017 2:33", "24/03/2020 4:05", 
"29/04/2020 21:00", "24/05/2020 2:39", "30/06/2020 21:00", "25/03/2020 4:11", 
"30/04/2020 4:32", "28/05/2020 3:21", "29/06/2020 2:52", "26/03/2020 4:21", 
"28/04/2020 21:00", "30/05/2020 3:21", "28/06/2020 2:29", "26/03/2023 3:51", 
"20/04/2023 3:00", "10/05/2023 2:53", "07/06/2023 2:55", "29/03/2023 3:35", 
"16/04/2023 4:06", "09/05/2023 2:55", "13/06/2023 2:58", "28/03/2023 3:56", 
"19/04/2023 3:08", "14/05/2023 3:00", "06/06/2023 3:00"), Temperature = c(21.9, 
23.1, 26.9, 20.7, 22.7, 27.1, 21.3, 21.1, 23.2, 22.6, 17.7, 20.2, 
23.8, 14.6, 19.9, 22.3, 28.7, 14.7, 16.6, 23.5, 23.5, 14.9, 17.8, 
20, 16.6, 18, 20.8, 16.7, 18.5, 21, 20.7, 17.6, 18.9, 23.4, 26.4, 
17.1, 20.5, 23.3, 25.7, 17, 20, 24.2, 16.9, 18.7, 23.1, 24.8, 
15.7, 29.4, 23.7, 23.9, 15.2, 17.7, 21, 25.8, 16.8, 18.1, 20.6, 
25, 15.4, 17.9, 21.8, 25, 17.9, 18.1, 21, 24.8, 17.5, 19.3, 20.8, 
24, 16.4, 19.4, 19.2, 23.7, 16.9, 25.2, 20.2, 22.6), Solar.Radiation = c(24.3, 
25.9, 24.5, 18.2, 25.7, 24.4, 26.2, 28.3, 22.7, 22.4, 24.6, 25.8, 
21.1, 19.5, 14.9, 22.4, 25.4, 21.1, 25.9, 19.1, 19.1, 11.4, 10.5, 
25.4, 17.7, 21.7, 25.7, 18.3, 20.2, 23, 16.8, 19.6, 22.2, 25.3, 
15.3, 22.8, 23.8, 21.2, 15.6, 23.2, 24.6, 19.4, 16.3, 20.6, 26.6, 
26.2, 21.1, 22, 26.4, 21.1, 16.1, 22.4, 24.9, 25.5, 13.4, 24.3, 
23.6, 19.5, 18.5, 8.7, 26.4, 19.5, 17.2, 24.3, 27.9, 22, 15.7, 
22, 26.3, 26.7, 16.2, 23.6, 25.2, 22.2, 20.4, 20.5, 25.9, 26.3
), Month = c("May", "June", "July", "May", "June", "July", "June", 
"June", "June", "April", "April", "May", "June", "March", "April", 
"May", "June", "March", "April", "May", "June", "March", "April", 
"May", "March", "April", "May", "March", "April", "May", "March", 
"April", "May", "June", "March", "April", "May", "June", "March", 
"April", "May", "June", "March", "April", "May", "June", "March", 
"April", "May", "June", "March", "April", "May", "June", "March", 
"April", "May", "June", "March", "April", "May", "June", "March", 
"April", "May", "June", "March", "April", "May", "June", "March", 
"April", "May", "June", "March", "April", "May", "June"), Sampling.Effort = c(0.75, 
0.75, 0.5, 0.75, 0.75, 0.75, 0.5, 0.75, 0.75, 1, 0.5, 1, 0.5, 
0.75, 1, 0.75, 0.75, 0.75, 0.75, 0.75, 0.75, 1, 1, 1, 1, 1, 1, 
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
1, 1, 1, 1, 1, 1, 1, 1, 1)), class = c("grouped_df", "tbl_df", 
"tbl", "data.frame"), row.names = c(NA, -78L), groups = structure(list(
    Year = structure(c(1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 4L, 
    4L, 4L, 5L, 5L, 5L, 6L, 6L, 6L, 7L, 7L, 7L), levels = c("2004", 
    "2007", "2010", "2013", "2017", "2020", "2023"), class = "factor"), 
    Transect = c("East", "North", "West", "East", "North", "West", 
    "East", "North", "West", "East", "North", "West", "East", 
    "North", "West", "East", "North", "West", "East", "North", 
    "West"), .rows = structure(list(1:3, 4:6, 7:9, 10:13, 14:17, 
        18:21, 22:24, 25:27, 28:30, 31:34, 35:38, 39:42, 43:46, 
        47:50, 51:54, 55:58, 59:62, 63:66, 67:70, 71:74, 75:78), ptype = integer(0), class = c("vctrs_list_of", 
    "vctrs_vctr", "list"))), class = c("tbl_df", "tbl", "data.frame"
), row.names = c(NA, -21L), .drop = TRUE))
0

There are 0 best solutions below