bird_list <- c("Anser brachyrhynchus",
"Branta leucopsis",
"Cygnus cygnus",
"Oxyura leucocephala",
"Ciconia ciconia", #"Ciconia ciconia ciconia",
"Platalea leucorodia", #"Platalea leucorodia leucorodia",
"Pelecanus crispus",
"Falco naumanni",
"Falco cherrug",
"Falco peregrinus", #"Falco peregrinus peregrinus",
"Falco peregrinus all others",
"Falco peregrinus brookei",
"Milvus milvus",
"Haliaeetus albicilla",
"Gypaetus barbatus",
"Gyps fulvus",
"Aegypius monachus",
"Aquila adalberti",
"Aquila heliaca",
"Grus grus", #"Grus grus grus"
"Sterna dougallii") #"Sterna dougallii dougallii")
#new_species_common <- c("Black stork", "Great white egret", "Osprey", "Black-winged stilt", "Bittern")
# New species binomials
new_species = c("Ciconia nigra", "Ardea alba", "Pandion haliaetus", "Himantopus himantopus", "Botaurus stellaris")
# Combine lists
bird_list = c(bird_list, new_species)
#### *** 2020 species data
bird_species <- fread("article_12_birds/Article12_2020_dataset_20210401_csv/Article12_2020_data_birds.csv", na.strings = 'NULL')
#write.csv(bird_species,"bird_species_check.csv")
intersect(bird_list, bird_species$speciesname)
## [1] "Anser brachyrhynchus" "Branta leucopsis" "Cygnus cygnus"
## [4] "Oxyura leucocephala" "Ciconia ciconia" "Platalea leucorodia"
## [7] "Pelecanus crispus" "Falco naumanni" "Falco cherrug"
## [10] "Falco peregrinus" "Milvus milvus" "Haliaeetus albicilla"
## [13] "Gypaetus barbatus" "Gyps fulvus" "Aegypius monachus"
## [16] "Aquila adalberti" "Aquila heliaca" "Grus grus"
## [19] "Sterna dougallii" "Ciconia nigra" "Ardea alba"
## [22] "Pandion haliaetus" "Himantopus himantopus" "Botaurus stellaris"
## 24 of 26 match****
#[1] "Falco peregrinus all others" "Falco peregrinus brookei"
# Restrict to those in list
# **
# ** Need to check matches as losing some
# **
bird_species_short <- bird_species[bird_species$speciesname %in% bird_list, ]
#names(bird_species_short)[names(bird_species_short) == "ĆÆ..specieshash"] <- "specieshash"
# Get the species codes (unique for each species)
speciescode <- unique(bird_species_short$speciescode)
# Threats info
#### *** 2020 data
bird_threats <- fread("article_12_birds/Article12_2020_dataset_20210401_csv/Article12_2020_data_bpressures_threats.csv", na.strings = 'NULL')
# Subset threats for species we care about
bird_threats <- bird_threats[bird_threats$speciescode %in% speciescode, ]
# Filter out 'no-pressure' codes
bird_threats = subset(bird_threats, pressurecode != "Xxt") # Get rid of Xxt
# Get rid of all of those starting with 'X'??
bird_threats = subset(bird_threats, !startsWith(bird_threats$pressurecode, "Xx"))
bird_threats = subset(bird_threats, !is.na(bird_threats$pressurecode))
bird_threats_n = bird_threats %>%
group_by(country, season, speciesname, speciescode) %>%
summarise(
n_threat = length(unique(pressurecode))
)
## `summarise()` has grouped output by 'country', 'season', 'speciesname'. You can override using the `.groups` argument.
# Cons measure info
#### *** 2020 data
bird_measures <- fread("article_12_birds/Article12_2020_dataset_20210401_csv/Article12_2020_data_bmeasures.csv", na.strings = 'NULL')
# Subset measures for species we care about
bird_measures <- bird_measures[bird_measures$speciescode %in% speciescode, ]
# Filter out 'no-measure' codes?
#bird_threats = subset(bird_threats, pressurecode != "Xxt") # Get rid of Xxt
bird_measures_n = bird_measures %>%
group_by(country, season, speciesname, speciescode) %>%
summarise(
n_measure = length(unique(measurecode))
)
## `summarise()` has grouped output by 'country', 'season', 'speciesname'. You can override using the `.groups` argument.
# Trend data - get columns from bird species table that we want to use
bird_trend_data = bird_species_short %>% select(country, speciesname, speciescode, season,
population_size_min, population_size_max, population_size,
population_trend_period, population_trend, population_trend_magnitude_min,
population_trend_magnitude_max, population_trend_method, #population_trend_quality,
population_trend_long_period, population_trend_long,
population_trend_long_magnitude_min, population_trend_long_magnitude_max,
population_trend_long_method,
distribution_trend_period, distribution_trend,
distribution_trend_magnitude_min, distribution_trend_magnitude_max, distribution_trend_magnitude,
distribution_trend_long_period, distribution_trend_long,
distribution_trend_long_magnitude_min, distribution_trend_long_magnitude_max, distribution_trend_long_magnitude,
distribution_trend_long_method)
# All together now!
# Combined measure data with threat data
full_dataB = merge(bird_trend_data, bird_threats_n, by = c('country', 'season', 'speciesname', 'speciescode'), all.x = TRUE)
# Combine those with trend data
full_data = merge(full_dataB, bird_measures_n, by=c('country', 'speciesname', 'speciescode', 'season'), all.x = TRUE)
# How many species do we end up with
length(unique(full_data$speciesname))
## [1] 24
table(full_data$speciesname)
##
## Aegypius monachus Anser brachyrhynchus Aquila adalberti
## 6 8 3
## Aquila heliaca Ardea alba Botaurus stellaris
## 13 43 34
## Branta leucopsis Ciconia ciconia Ciconia nigra
## 23 34 32
## Cygnus cygnus Falco cherrug Falco naumanni
## 37 15 16
## Falco peregrinus Grus grus Gypaetus barbatus
## 31 41 5
## Gyps fulvus Haliaeetus albicilla Himantopus himantopus
## 12 40 32
## Milvus milvus Oxyura leucocephala Pandion haliaetus
## 28 8 33
## Pelecanus crispus Platalea leucorodia Sterna dougallii
## 9 32 7
# Keep only breeding season stats
full_data_breeding = subset(full_data, season == "B" | season == "W")
full_data_breeding = subset(full_data_breeding, !is.na(speciesname))
# Make model dataset by counting measures and threats and getting a single value for trend for each sp. in each country (thus the use of unique)
model_data = full_data_breeding
model_data$population_size_mean = (model_data$population_size_min + model_data$population_size_max)/2.0
model_data$population_trend_long_magnitude_mean = (model_data$population_trend_long_magnitude_min + model_data$population_trend_long_magnitude_max) / 2.0
# %>%
# group_by(country, speciesname, speciescode) %>%
# summarise(
# n_measure = length(unique(measurecode)),
# n_threat = length(unique(pressurecode)),
# population_size_min = unique(population_size_min),
# population_size_max = unique(population_size_max),
# population_size_mean = (unique(population_size_min) + unique(population_size_max)/2),
# population_trend = unique(population_trend),
# population_trend_long = unique(population_trend_long),
# population_trend_long_magnitude_min = unique(population_trend_long_magnitude_min),
# population_trend_long_magnitude_max = unique(population_trend_long_magnitude_max),
# population_trend_long_magnitude_mean = (unique(population_trend_long_magnitude_min) + unique(population_trend_long_magnitude_max) / 2.0))
# Subset for Increasing/declining/stable/fluctuating
#model_data = subset(model_data, population_trend_long == "I" | population_trend_long == "D" | population_trend_long == "S" | population_trend_long == "F")
# Alter trend data to make sign correct
model_data$population_trend_long_magnitude_min = ifelse(model_data$population_trend_long == "D", -1*model_data$population_trend_long_magnitude_min, model_data$population_trend_long_magnitude_min)
model_data$population_trend_long_magnitude_max = ifelse(model_data$population_trend_long == "D", -1*model_data$population_trend_long_magnitude_max, model_data$population_trend_long_magnitude_max)
# Binomial model data
model_data_binom = model_data
model_data_binom$population_trend = factor(model_data_binom$population_trend)
# Subset trend to only those increasing/declining
model_data_binom = subset(model_data_binom, population_trend == "D" | population_trend == "I")
model_data_binom$increasing = ifelse(model_data_binom$population_trend == "I", 1, 0)
# Binomial model data (long)
model_data_binom_long = model_data
model_data_binom_long$population_trend_long = factor(model_data_binom_long$population_trend_long)
# Subset trend to only those increasing/declining
model_data_binom_long = subset(model_data_binom_long, population_trend_long == "D" | population_trend_long == "I")
model_data_binom_long$population_trend_long = droplevels(model_data_binom_long$population_trend_long)
model_data_binom_long$increasing_long = ifelse(model_data_binom_long$population_trend_long == "I", 1, 0)
# Binomial model data
model_data_binom_range = model_data
model_data_binom_range$distribution_trend = factor(model_data_binom_range$distribution_trend)
# Subset trend to only those increasing/declining
model_data_binom_range = subset(model_data_binom_range, distribution_trend == "D" | distribution_trend == "I")
model_data_binom_range$expanding = ifelse(model_data_binom_range$distribution_trend == "I", 1, 0)
# Binomial model data (long)
model_data_binom_range_long = model_data
model_data_binom_range_long$distribution_trend_long = factor(model_data_binom_range_long$distribution_trend_long)
# Subset trend to only those increasing/declining
model_data_binom_range_long = subset(model_data_binom_range_long, distribution_trend_long == "D" | distribution_trend_long == "I")
model_data_binom_range_long$distribution_trend_long = droplevels(model_data_binom_range_long$distribution_trend_long)
model_data_binom_range_long$expanding_long = ifelse(model_data_binom_range_long$distribution_trend_long == "I", 1, 0)
# How many do we have
table(model_data_binom$speciesname, model_data_binom$country)
##
## AT BE BG CY CZ DE DK EE ES ESIC FI FR GIB GR HR HU IE
## Aegypius monachus 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 0
## Anser brachyrhynchus 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## Aquila adalberti 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0
## Aquila heliaca 1 0 2 0 1 0 0 0 0 0 0 0 0 0 1 1 0
## Ardea alba 1 2 2 0 1 2 0 1 2 0 0 2 0 2 0 0 0
## Botaurus stellaris 1 1 2 0 1 1 0 0 0 0 1 0 0 1 1 0 0
## Branta leucopsis 0 1 0 0 1 2 2 0 0 0 1 0 0 0 0 0 1
## Ciconia ciconia 1 1 1 0 0 1 0 1 0 0 0 1 0 1 0 0 0
## Ciconia nigra 0 1 0 0 0 1 0 1 1 0 0 1 0 1 0 0 0
## Cygnus cygnus 0 0 1 0 1 2 1 1 0 0 2 1 0 1 0 0 1
## Falco cherrug 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0
## Falco naumanni 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 0
## Falco peregrinus 0 1 0 0 1 1 1 0 0 1 0 1 0 1 0 1 0
## Grus grus 0 0 0 0 0 2 1 0 1 0 1 2 0 0 0 0 0
## Gypaetus barbatus 1 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 0
## Gyps fulvus 0 0 1 1 0 0 0 0 1 0 0 1 0 1 0 0 0
## Haliaeetus albicilla 2 0 1 0 2 1 1 1 0 0 2 2 0 1 1 2 1
## Himantopus himantopus 1 1 0 0 1 0 0 0 2 0 0 0 0 0 1 0 0
## Milvus milvus 1 1 0 0 1 0 1 0 1 0 0 1 0 0 0 1 1
## Oxyura leucocephala 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0
## Pandion haliaetus 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0
## Pelecanus crispus 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
## Platalea leucorodia 1 2 0 0 0 1 1 0 1 0 0 2 0 0 1 1 0
## Sterna dougallii 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1
##
## IT LT LU LV MT NL PL PT RO SE SI SK UK
## Aegypius monachus 0 0 0 0 0 0 0 1 0 0 0 0 0
## Anser brachyrhynchus 0 0 0 0 0 1 0 0 0 1 0 0 1
## Aquila adalberti 0 0 0 0 0 0 0 1 0 0 0 0 0
## Aquila heliaca 0 0 0 0 0 0 0 0 1 0 0 1 0
## Ardea alba 1 1 1 1 0 2 2 1 1 0 0 1 1
## Botaurus stellaris 0 1 0 0 0 1 1 0 0 1 0 1 2
## Branta leucopsis 0 0 0 0 0 2 0 0 0 2 0 0 3
## Ciconia ciconia 1 1 1 1 0 1 1 0 0 1 0 1 0
## Ciconia nigra 1 1 1 1 0 0 0 1 0 0 0 1 0
## Cygnus cygnus 0 1 0 1 0 1 2 0 0 2 0 0 2
## Falco cherrug 0 0 0 0 0 0 0 0 1 0 0 1 0
## Falco naumanni 1 0 0 0 0 0 0 1 0 0 0 0 0
## Falco peregrinus 0 0 1 0 0 2 1 0 1 1 0 1 0
## Grus grus 1 1 0 1 0 1 1 1 0 1 0 1 1
## Gypaetus barbatus 1 0 0 0 0 0 0 0 0 0 0 0 0
## Gyps fulvus 1 0 0 0 0 0 0 0 0 0 0 0 0
## Haliaeetus albicilla 0 2 0 0 0 2 2 0 0 2 1 2 1
## Himantopus himantopus 0 0 0 0 1 1 0 1 0 0 0 0 1
## Milvus milvus 2 1 1 1 0 0 1 1 0 1 0 0 1
## Oxyura leucocephala 0 0 0 0 0 0 0 0 0 0 0 0 0
## Pandion haliaetus 0 0 0 0 0 0 1 2 0 0 0 0 1
## Pelecanus crispus 0 0 0 0 0 0 0 0 0 0 0 0 0
## Platalea leucorodia 1 0 0 0 0 1 0 2 0 0 0 0 1
## Sterna dougallii 0 0 0 0 0 0 0 0 0 0 0 0 1
# First model (binomial)
library(lme4)
## Loading required package: Matrix
##
## Attaching package: 'lme4'
## The following object is masked from 'package:expss':
##
## dummy
library(sjPlot)
## Install package "strengejacke" from GitHub (`devtools::install_github("strengejacke/strengejacke")`) to load all sj-packages at once!
# Dont think we need unweighted model anymore
# m1 = glmer(population_trend ~ n_measure + n_threat + (1|speciesname),
# data = subset(model_data_binom, season = "B"),family = "binomial")
# # Adding 'country' throws singularities due to sparse data
# summary(m1)
# tab_model(m1)
# plot_model(m1)
Are populations more likely to be increasing if they have more threats/measures?
m1wA = glmer(increasing ~ n_measure + n_threat + (1|speciesname) ,
data = subset(model_data_binom, season = "B"), weights = log10(population_size_mean + 1), family = "binomial")
## Warning in eval(family$initialize, rho): non-integer #successes in a binomial
## glm!
m1wB = glmer(increasing ~ n_measure * n_threat + (1|speciesname) ,
data = subset(model_data_binom, season = "B"), weights = log10(population_size_mean + 1), family = "binomial")
## Warning in eval(family$initialize, rho): non-integer #successes in a binomial
## glm!
# Adding 'country' throws singularities due to sparse data
#AIC(m1wA, m1wB)
#summary(m1wB)
tab_model(m1wA, m1wB, show.aicc = TRUE)
| Ā | increasing | increasing | ||||
|---|---|---|---|---|---|---|
| Predictors | Odds Ratios | CI | p | Odds Ratios | CI | p |
| (Intercept) | 35.25 | 4.15Ā āĀ 299.76 | 0.001 | 62.26 | 6.60Ā āĀ 587.08 | <0.001 |
| n_measure | 1.08 | 0.93Ā āĀ 1.26 | 0.311 | 0.93 | 0.72Ā āĀ 1.20 | 0.559 |
| n_threat | 0.92 | 0.80Ā āĀ 1.06 | 0.273 | 0.81 | 0.64Ā āĀ 1.02 | 0.077 |
| n_measure * n_threat | 1.03 | 0.99Ā āĀ 1.06 | 0.165 | |||
| Random Effects | ||||||
| Ļ2 | 3.29 | 3.29 | ||||
| Ļ00 | 9.44 speciesname | 8.80 speciesname | ||||
| ICC | 0.74 | 0.73 | ||||
| N | 22 speciesname | 22 speciesname | ||||
| Observations | 161 | 161 | ||||
| Marginal R2 / Conditional R2 | 0.003 / 0.743 | 0.008 / 0.730 | ||||
| AIC | 239.583 | 239.760 | ||||
plot_model(m1wB)
plot_model(m1wB, type = "int")
m1w_longA = glmer(increasing_long ~ n_measure + n_threat + (1|speciesname),
data = subset(model_data_binom_long, season = "B"), weights = log10(population_size_mean + 1),family = "binomial")
## Warning in eval(family$initialize, rho): non-integer #successes in a binomial
## glm!
m1w_longB = glmer(increasing_long ~ n_measure * n_threat + (1|speciesname),
data = subset(model_data_binom_long, season = "B"), weights = log10(population_size_mean + 1),family = "binomial")
## Warning in eval(family$initialize, rho): non-integer #successes in a binomial
## glm!
#AIC(m1w_longA, m1w_longB)
#summary(m1w_longB)
#summary(m1w_longB)
tab_model(m1w_longA, m1w_longB)
| Ā | increasing_long | increasing_long | ||||
|---|---|---|---|---|---|---|
| Predictors | Odds Ratios | CI | p | Odds Ratios | CI | p |
| (Intercept) | 46.76 | 11.67Ā āĀ 187.42 | <0.001 | 182.99 | 26.00Ā āĀ 1287.74 | <0.001 |
| n_measure | 1.00 | 0.86Ā āĀ 1.17 | 0.978 | 0.75 | 0.56Ā āĀ 1.00 | 0.053 |
| n_threat | 0.90 | 0.77Ā āĀ 1.04 | 0.152 | 0.71 | 0.55Ā āĀ 0.92 | 0.009 |
| n_measure * n_threat | 1.04 | 1.00Ā āĀ 1.08 | 0.027 | |||
| Random Effects | ||||||
| Ļ2 | 3.29 | 3.29 | ||||
| Ļ00 | 3.02 speciesname | 3.03 speciesname | ||||
| ICC | 0.48 | 0.48 | ||||
| N | 23 speciesname | 23 speciesname | ||||
| Observations | 203 | 203 | ||||
| Marginal R2 / Conditional R2 | 0.020 / 0.489 | 0.059 / 0.510 | ||||
plot_model(m1w_longB)
plot_model(m1w_longB, type = "int")
Are species more likely to be expanding if they have more threats/measures?
m1wA_range = glmer(expanding ~ n_measure + n_threat + (1|speciesname) ,
data = subset(model_data_binom_range, season = "B"), weights = log10(population_size_mean + 1),family = "binomial")
## Warning in eval(family$initialize, rho): non-integer #successes in a binomial
## glm!
m1wB_range = glmer(expanding ~ n_measure * n_threat + (1|speciesname) ,
data = subset(model_data_binom_range, season = "B"), weights = log10(population_size_mean + 1),family = "binomial")
## Warning in eval(family$initialize, rho): non-integer #successes in a binomial
## glm!
# Adding 'country' throws singularities due to sparse data
#AIC(m1wA_range, m1wB_range)
#summary(m1wB_range)
tab_model(m1wA_range, m1wB_range, show.aicc = TRUE)
| Ā | expanding | expanding | ||||
|---|---|---|---|---|---|---|
| Predictors | Odds Ratios | CI | p | Odds Ratios | CI | p |
| (Intercept) | 72.38 | 8.80Ā āĀ 595.23 | <0.001 | 39.33 | 3.36Ā āĀ 461.10 | 0.003 |
| n_measure | 1.32 | 1.06Ā āĀ 1.63 | 0.012 | 1.73 | 0.96Ā āĀ 3.13 | 0.067 |
| n_threat | 0.65 | 0.51Ā āĀ 0.82 | <0.001 | 0.74 | 0.53Ā āĀ 1.03 | 0.071 |
| n_measure * n_threat | 0.97 | 0.90Ā āĀ 1.03 | 0.297 | |||
| Random Effects | ||||||
| Ļ2 | 3.29 | 3.29 | ||||
| Ļ00 | 4.80 speciesname | 6.16 speciesname | ||||
| ICC | 0.59 | 0.65 | ||||
| N | 22 speciesname | 22 speciesname | ||||
| Observations | 122 | 122 | ||||
| Marginal R2 / Conditional R2 | 0.118 / 0.641 | 0.138 / 0.700 | ||||
| AIC | 166.056 | 167.037 | ||||
** No clear support for interaction
plot_model(m1wA_range)
plot_model(m1wA_range, type = "pred", terms = c("n_threat", "n_measure"))
Same for long term trend
m1wA_range_long = glmer(expanding_long ~ n_measure + n_threat + (1|speciesname) ,
data = subset(model_data_binom_range_long, season = "B"), weights = log10(population_size_mean + 1),family = "binomial")
## Warning in eval(family$initialize, rho): non-integer #successes in a binomial
## glm!
m1wB_range_long = glmer(expanding_long ~ n_measure * n_threat + (1|speciesname) ,
data = subset(model_data_binom_range_long, season = "B"), weights = log10(population_size_mean + 1),family = "binomial")
## Warning in eval(family$initialize, rho): non-integer #successes in a binomial
## glm!
# Adding 'country' throws singularities due to sparse data
#AIC(m1wA_range_long, m1wB_range_long)
#summary(m1wB_range_long)
tab_model(m1wA_range_long, m1wB_range_long, show.aicc = TRUE)
| Ā | expanding_long | expanding_long | ||||
|---|---|---|---|---|---|---|
| Predictors | Odds Ratios | CI | p | Odds Ratios | CI | p |
| (Intercept) | 2015.84 | 119.84Ā āĀ 33909.00 | <0.001 | 76590.71 | 202.63Ā āĀ 28950028.29 | <0.001 |
| n_measure | 1.12 | 0.88Ā āĀ 1.43 | 0.356 | 0.57 | 0.25Ā āĀ 1.31 | 0.183 |
| n_threat | 0.54 | 0.39Ā āĀ 0.74 | <0.001 | 0.33 | 0.16Ā āĀ 0.68 | 0.003 |
| n_measure * n_threat | 1.09 | 0.99Ā āĀ 1.20 | 0.097 | |||
| Random Effects | ||||||
| Ļ2 | 3.29 | 3.29 | ||||
| Ļ00 | 4.01 speciesname | 3.61 speciesname | ||||
| ICC | 0.55 | 0.52 | ||||
| N | 21 speciesname | 21 speciesname | ||||
| Observations | 145 | 145 | ||||
| Marginal R2 / Conditional R2 | 0.303 / 0.686 | 0.482 / 0.753 | ||||
| AIC | 136.288 | 135.175 | ||||
*Again, no clear support for interaction
plot_model(m1wA_range_long)
plot_model(m1wA_range_long, type = "pred", terms = c("n_threat", "n_measure"))
# tab = table(model_data$speciesname, model_data$country)
# margin.table(tab, 2)
#
#
# m1_mean = lmer(population_trend_long_magnitude_mean ~ n_measure + n_threat + (1|speciesname) + (1|country),
# data = model_data)
# m1_mean.2 = lmer(population_trend_long_magnitude_mean ~ n_measure*n_threat + (1|speciesname) + (1|country),
# data = model_data)
#
# AIC(m1_mean, m1_mean.2)
# summary(m1_mean.2)
# plot_model(m1_mean.2, show.intercept = TRUE)
# #plot_model(m1_mean.2, type="re")
# plot_model(m1_mean.2, type = "int")
#
# # Next model is only actual value of trend
#
# model_data = subset(model_data, !is.na(population_size_mean))
# m1_mean_w = lmer(log10(population_trend_long_magnitude_mean + 1) ~ n_measure + n_threat + (1|speciesname) + (1|country),
# weights = log10(population_size_mean + 1), data = model_data)
# m1_mean_w.2 = lmer(log10(population_trend_long_magnitude_mean + 1) ~ n_measure*n_threat + (1|speciesname) + (1|country),
# weights = log10(population_size_mean + 1), data = model_data)
# # INF***
# AIC(m1_mean_w, m1_mean_w.2)
#
# summary(m1_mean)
# plot_model(m1_mean_w)
# plot_model(m1_mean_w, type = "pred", terms = c("n_measure", "n_threat"))
sessionInfo()
## R version 4.0.3 (2020-10-10)
## Platform: x86_64-apple-darwin17.0 (64-bit)
## Running under: macOS Catalina 10.15.7
##
## Matrix products: default
## BLAS: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
##
## locale:
## [1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] sjPlot_2.8.7 lme4_1.1-26 Matrix_1.2-18 data.table_1.13.6
## [5] expss_0.10.7 dplyr_1.0.7 plyr_1.8.6
##
## loaded via a namespace (and not attached):
## [1] Rcpp_1.0.7 mvtnorm_1.1-1 lattice_0.20-41 tidyr_1.1.2
## [5] assertthat_0.2.1 digest_0.6.27 utf8_1.2.1 R6_2.5.0
## [9] backports_1.2.1 coda_0.19-4 evaluate_0.14 highr_0.9
## [13] ggplot2_3.3.3 pillar_1.6.1 rlang_0.4.11 rstudioapi_0.13
## [17] minqa_1.2.4 performance_0.7.0 nloptr_1.2.2.2 checkmate_2.0.0
## [21] effectsize_0.4.3 rmarkdown_2.6 labeling_0.4.2 ggeffects_1.0.1
## [25] splines_4.0.3 statmod_1.4.35 stringr_1.4.0 foreign_0.8-81
## [29] htmlwidgets_1.5.3 munsell_0.5.0 broom_0.7.5 modelr_0.1.8
## [33] compiler_4.0.3 xfun_0.24 pkgconfig_2.0.3 parameters_0.11.0
## [37] htmltools_0.5.1.1 insight_0.12.0 tidyselect_1.1.1 tibble_3.1.2
## [41] htmlTable_2.1.0 matrixStats_0.58.0 fansi_0.5.0 crayon_1.4.1
## [45] MASS_7.3-53 sjmisc_2.8.6 grid_4.0.3 xtable_1.8-4
## [49] nlme_3.1-149 gtable_0.3.0 lifecycle_1.0.0 DBI_1.1.1
## [53] magrittr_2.0.1 bayestestR_0.8.2 scales_1.1.1 estimability_1.3
## [57] stringi_1.6.2 farver_2.1.0 ellipsis_0.3.2 generics_0.1.0
## [61] vctrs_0.3.8 boot_1.3-25 sjlabelled_1.1.7 RColorBrewer_1.1-2
## [65] tools_4.0.3 glue_1.4.2 purrr_0.3.4 sjstats_0.18.1
## [69] emmeans_1.5.4 yaml_2.2.1 colorspace_2.0-0 knitr_1.33