limits = c(0,150)) +
labs(x = "Sociality",
y = "Faecal cortisol metabolite\nconcentration ng/g") +
theme_bw(base_size = 16) +
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank())
soc_male_aug_plot <- soc_male_aug %>%
mutate(soc_num = if_else(sociality == "Social", 1, 1.7))
av_soc_male <- soc_male_aug_plot %>%
group_by(sociality) %>%
summarise(mn_raw = mean(cort),
mn_fit = mean(exp(.fitted)),
se_raw = sd(cort)/sqrt(n()),
se_fit = sd(exp(.fitted))/sqrt(n()),
soc_num = soc_num[1],
soc_start = soc_num[1] - 0.18,
soc_end = soc_num[1] + 0.18)
ggplot(soc_male_aug_plot, aes(x = soc_num, y = cort)) +
geom_jitter(width = 0.2, size = 4,
alpha = 0.5, colour = "lightskyblue") +
geom_segment(data = av_soc_male, aes(x = soc_start, xend = soc_end,
y = mn_raw, yend = mn_raw)) +
geom_errorbar(data = av_soc_male, aes(ymax = mn_fit + se_fit,
ymin = mn_fit - se_fit, y = NULL),
width = 0.01, colour = "black") +
geom_point(data = av_soc_male, aes(x = soc_num, y = mn_fit),
size = 3, colour = "black") +
scale_x_continuous(breaks = c(1,1.7), labels = c("Social", "Solitary")) +
scale_y_continuous(breaks = seq(0,150, by = 30),
labels = seq(0,150, by = 30),
limits = c(0,150)) +
labs(x = "Sociality",
y = "Faecal cortisol metabolite\nconcentration ng/g") +
theme_bw(base_size = 16) +
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank())
ggplot(soc_male_aug_plot, aes(x = soc_num, y = cort)) +
geom_jitter(width = 0.2, size = 4,
alpha = 0.5, colour = "lightskyblue") +
geom_segment(data = av_soc_male, aes(x = soc_start, xend = soc_end,
y = mn_raw, yend = mn_raw)) +
geom_errorbar(data = av_soc_male, aes(ymax = mn_fit + se_fit,
ymin = mn_fit - se_fit, y = NULL),
width = 0.025, colour = "black") +
geom_point(data = av_soc_male, aes(x = soc_num, y = mn_fit),
size = 3, colour = "black") +
scale_x_continuous(breaks = c(1,1.7), labels = c("Social", "Solitary")) +
scale_y_continuous(breaks = seq(0,150, by = 30),
labels = seq(0,150, by = 30),
limits = c(0,150)) +
labs(x = "Sociality",
y = "Faecal cortisol metabolite\nconcentration ng/g") +
theme_bw(base_size = 16) +
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank())
ggplot(soc_male_aug_plot, aes(x = soc_num, y = cort)) +
geom_jitter(width = 0.12, size = 4,
alpha = 0.5, colour = "lightskyblue") +
geom_segment(data = av_soc_male, aes(x = soc_start, xend = soc_end,
y = mn_raw, yend = mn_raw)) +
geom_errorbar(data = av_soc_male, aes(ymax = mn_fit + se_fit,
ymin = mn_fit - se_fit, y = NULL),
width = 0.025, colour = "black") +
geom_point(data = av_soc_male, aes(x = soc_num, y = mn_fit),
size = 3, colour = "black") +
scale_x_continuous(breaks = c(1,1.7), labels = c("Social", "Solitary")) +
scale_y_continuous(breaks = seq(0,150, by = 30),
labels = seq(0,150, by = 30),
limits = c(0,150)) +
labs(x = "Sociality",
y = "Faecal cortisol metabolite\nconcentration ng/g") +
theme_bw(base_size = 16) +
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank())
soc_male_aug_plot <- soc_male_aug %>%
mutate(soc_num = if_else(sociality == "Social", 1, 1.4))
av_soc_male <- soc_male_aug_plot %>%
group_by(sociality) %>%
summarise(mn_raw = mean(cort),
mn_fit = mean(exp(.fitted)),
se_raw = sd(cort)/sqrt(n()),
se_fit = sd(exp(.fitted))/sqrt(n()),
soc_num = soc_num[1],
soc_start = soc_num[1] - 0.08,
soc_end = soc_num[1] + 0.08)
fig1a <- ggplot(soc_male_aug_plot, aes(x = soc_num, y = cort)) +
geom_jitter(width = 0.1, size = 4,
alpha = 0.5, colour = "lightskyblue") +
geom_segment(data = av_soc_male, aes(x = soc_start, xend = soc_end,
y = mn_raw, yend = mn_raw)) +
geom_errorbar(data = av_soc_male, aes(ymax = mn_fit + se_fit,
ymin = mn_fit - se_fit, y = NULL),
width = 0.025, colour = "black") +
geom_point(data = av_soc_male, aes(x = soc_num, y = mn_fit),
size = 3, colour = "black") +
scale_x_continuous(breaks = c(1,1.4), labels = c("Social", "Solitary")) +
scale_y_continuous(breaks = seq(0,150, by = 30),
labels = seq(0,150, by = 30),
limits = c(0,150)) +
labs(x = "Sociality",
y = "Faecal cortisol metabolite\nconcentration ng/g") +
theme_bw(base_size = 16) +
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank())
fig1a
ggplot(soc_male_aug_plot, aes(x = soc_num, y = cort)) +
geom_jitter(width = 0.1, size = 4,
alpha = 0.5, colour = "lightskyblue") +
geom_segment(data = av_soc_male, aes(x = soc_start, xend = soc_end,
y = mn_raw, yend = mn_raw)) +
geom_errorbar(data = av_soc_male, aes(ymax = mn_fit + se_fit,
ymin = mn_fit - se_fit, y = NULL),
width = 0.025, colour = "black") +
geom_point(data = av_soc_male, aes(x = soc_num, y = mn_fit),
size = 3, colour = "black") +
scale_x_continuous(breaks = c(1,1.4), labels = c("Social", "Solitary"),
limits = c(0.7, 1.6)) +
scale_y_continuous(breaks = seq(0,150, by = 30),
labels = seq(0,150, by = 30),
limits = c(0,150)) +
labs(x = "Sociality",
y = "Faecal cortisol metabolite\nconcentration ng/g") +
theme_bw(base_size = 16) +
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank())
ggplot(soc_male_aug_plot, aes(x = soc_num, y = cort)) +
geom_jitter(width = 0.1, size = 4,
alpha = 0.5, colour = "lightskyblue") +
geom_segment(data = av_soc_male, aes(x = soc_start, xend = soc_end,
y = mn_raw, yend = mn_raw)) +
geom_errorbar(data = av_soc_male, aes(ymax = mn_fit + se_fit,
ymin = mn_fit - se_fit, y = NULL),
width = 0.025, colour = "black") +
geom_point(data = av_soc_male, aes(x = soc_num, y = mn_fit),
size = 3, colour = "black") +
scale_x_continuous(breaks = c(1,1.4), labels = c("Social", "Solitary"),
limits = c(0.7, 1.6)) +
scale_y_continuous(breaks = seq(0,150, by = 30),
labels = seq(0,150, by = 30),
limits = c(0,150)) +
labs(x = "Sociality",
y = "Faecal cortisol metabolite\nconcentration ng/g") +
theme_bw(base_size = 16) +
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank())
ggplot(soc_male_aug_plot, aes(x = soc_num, y = cort)) +
geom_jitter(width = 0.1, size = 4,
alpha = 0.5, colour = "lightskyblue") +
geom_segment(data = av_soc_male, aes(x = soc_start, xend = soc_end,
y = mn_raw, yend = mn_raw)) +
geom_errorbar(data = av_soc_male, aes(ymax = mn_fit + se_fit,
ymin = mn_fit - se_fit, y = NULL),
width = 0.025, colour = "black") +
geom_point(data = av_soc_male, aes(x = soc_num, y = mn_fit),
size = 3, colour = "black") +
scale_x_continuous(breaks = c(1,1.4), labels = c("Social", "Solitary"),
limits = c(0.8, 1.5)) +
scale_y_continuous(breaks = seq(0,150, by = 30),
labels = seq(0,150, by = 30),
limits = c(0,150)) +
labs(x = "Sociality",
y = "Faecal cortisol metabolite\nconcentration ng/g") +
theme_bw(base_size = 16) +
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank())
ggplot(soc_male_aug_plot, aes(x = soc_num, y = cort)) +
geom_jitter(width = 0.1, size = 4,
alpha = 0.5, colour = "lightskyblue") +
geom_segment(data = av_soc_male, aes(x = soc_start, xend = soc_end,
y = mn_raw, yend = mn_raw)) +
geom_errorbar(data = av_soc_male, aes(ymax = mn_fit + se_fit,
ymin = mn_fit - se_fit, y = NULL),
width = 0.025, colour = "black") +
geom_point(data = av_soc_male, aes(x = soc_num, y = mn_fit),
size = 3, colour = "black") +
scale_x_continuous(breaks = c(1,1.4), labels = c("Social", "Solitary"),
limits = c(0.9, 1.5)) +
scale_y_continuous(breaks = seq(0,150, by = 30),
labels = seq(0,150, by = 30),
limits = c(0,150)) +
labs(x = "Sociality",
y = "Faecal cortisol metabolite\nconcentration ng/g") +
theme_bw(base_size = 16) +
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank())
ggplot(soc_male_aug_plot, aes(x = soc_num, y = cort)) +
geom_jitter(width = 0.1, size = 4,
alpha = 0.5, colour = "lightskyblue") +
geom_segment(data = av_soc_male, aes(x = soc_start, xend = soc_end,
y = mn_raw, yend = mn_raw)) +
geom_errorbar(data = av_soc_male, aes(ymax = mn_fit + se_fit,
ymin = mn_fit - se_fit, y = NULL),
width = 0.025, colour = "black") +
geom_point(data = av_soc_male, aes(x = soc_num, y = mn_fit),
size = 3, colour = "black") +
scale_x_continuous(breaks = c(1,1.4), labels = c("Social", "Solitary"),
limits = c(0.9, 1.5)) +
scale_y_continuous(breaks = seq(0,150, by = 30),
labels = seq(0,150, by = 30),
limits = c(0,150)) +
labs(x = "Sociality",
y = "Faecal cortisol metabolite\nconcentration ng/g",
tag = "a)") +
theme_bw(base_size = 16) +
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank())
ggplot(soc_male_aug_plot, aes(x = soc_num, y = cort)) +
geom_jitter(width = 0.1, size = 4,
alpha = 0.5, colour = "lightskyblue") +
geom_segment(data = av_soc_male, aes(x = soc_start, xend = soc_end,
y = mn_raw, yend = mn_raw)) +
geom_errorbar(data = av_soc_male, aes(ymax = mn_fit + se_fit,
ymin = mn_fit - se_fit, y = NULL),
width = 0.025, colour = "black") +
geom_point(data = av_soc_male, aes(x = soc_num, y = mn_fit),
size = 3, colour = "black") +
scale_x_continuous(breaks = c(1,1.2), labels = c("Social", "Solitary"),
limits = c(0.9, 1.3)) +
scale_y_continuous(breaks = seq(0,150, by = 30),
labels = seq(0,150, by = 30),
limits = c(0,150)) +
labs(x = "Sociality",
y = "Faecal cortisol metabolite\nconcentration ng/g",
tag = "a)") +
theme_bw(base_size = 16) +
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank())
soc_male_aug_plot <- soc_male_aug %>%
mutate(soc_num = if_else(sociality == "Social", 1, 1.2))
av_soc_male <- soc_male_aug_plot %>%
group_by(sociality) %>%
summarise(mn_raw = mean(cort),
mn_fit = mean(exp(.fitted)),
se_raw = sd(cort)/sqrt(n()),
se_fit = sd(exp(.fitted))/sqrt(n()),
soc_num = soc_num[1],
soc_start = soc_num[1] - 0.08,
soc_end = soc_num[1] + 0.08)
ggplot(soc_male_aug_plot, aes(x = soc_num, y = cort)) +
geom_jitter(width = 0.1, size = 4,
alpha = 0.5, colour = "lightskyblue") +
geom_segment(data = av_soc_male, aes(x = soc_start, xend = soc_end,
y = mn_raw, yend = mn_raw)) +
geom_errorbar(data = av_soc_male, aes(ymax = mn_fit + se_fit,
ymin = mn_fit - se_fit, y = NULL),
width = 0.025, colour = "black") +
geom_point(data = av_soc_male, aes(x = soc_num, y = mn_fit),
size = 3, colour = "black") +
scale_x_continuous(breaks = c(1,1.2), labels = c("Social", "Solitary"),
limits = c(0.9, 1.3)) +
scale_y_continuous(breaks = seq(0,150, by = 30),
labels = seq(0,150, by = 30),
limits = c(0,150)) +
labs(x = "Sociality",
y = "Faecal cortisol metabolite\nconcentration ng/g",
tag = "a)") +
theme_bw(base_size = 16) +
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank())
soc_male_aug_plot <- soc_male_aug %>%
mutate(soc_num = if_else(sociality == "Social", 1, 1.23))
av_soc_male <- soc_male_aug_plot %>%
group_by(sociality) %>%
summarise(mn_raw = mean(cort),
mn_fit = mean(exp(.fitted)),
se_raw = sd(cort)/sqrt(n()),
se_fit = sd(exp(.fitted))/sqrt(n()),
soc_num = soc_num[1],
soc_start = soc_num[1] - 0.08,
soc_end = soc_num[1] + 0.08)
fig1a <- ggplot(soc_male_aug_plot, aes(x = soc_num, y = cort)) +
geom_jitter(width = 0.1, size = 4,
alpha = 0.5, colour = "lightskyblue") +
geom_segment(data = av_soc_male, aes(x = soc_start, xend = soc_end,
y = mn_raw, yend = mn_raw)) +
geom_errorbar(data = av_soc_male, aes(ymax = mn_fit + se_fit,
ymin = mn_fit - se_fit, y = NULL),
width = 0.025, colour = "black") +
geom_point(data = av_soc_male, aes(x = soc_num, y = mn_fit),
size = 3, colour = "black") +
scale_x_continuous(breaks = c(1,1.23), labels = c("Social", "Solitary"),
limits = c(0.9, 1.3)) +
scale_y_continuous(breaks = seq(0,150, by = 30),
labels = seq(0,150, by = 30),
limits = c(0,150)) +
labs(x = "Sociality",
y = "Faecal cortisol metabolite\nconcentration ng/g",
tag = "a)") +
theme_bw(base_size = 16) +
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank())
fig1a
ggplot(soc_male_aug_plot, aes(x = soc_num, y = cort)) +
geom_jitter(width = 0.1, size = 4,
alpha = 0.5, colour = "lightskyblue") +
geom_segment(data = av_soc_male, aes(x = soc_start, xend = soc_end,
y = mn_raw, yend = mn_raw)) +
geom_errorbar(data = av_soc_male, aes(ymax = mn_fit + se_fit,
ymin = mn_fit - se_fit, y = NULL),
width = 0.025, colour = "black") +
geom_point(data = av_soc_male, aes(x = soc_num, y = mn_fit),
size = 3, colour = "black") +
scale_x_continuous(breaks = c(1,1.23), labels = c("Social", "Solitary"),
limits = c(0.9, 1.33)) +
scale_y_continuous(breaks = seq(0,150, by = 30),
labels = seq(0,150, by = 30),
limits = c(0,150)) +
labs(x = "Sociality",
y = "Faecal cortisol metabolite\nconcentration ng/g",
tag = "a)") +
theme_bw(base_size = 16) +
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank())
ggplot(soc_male_aug_plot, aes(x = soc_num, y = cort)) +
geom_jitter(width = 0.1, size = 4,
alpha = 0.5, colour = "lightskyblue") +
geom_segment(data = av_soc_male, aes(x = soc_start, xend = soc_end,
y = mn_raw, yend = mn_raw)) +
geom_errorbar(data = av_soc_male, aes(ymax = mn_fit + se_fit,
ymin = mn_fit - se_fit, y = NULL),
width = 0.025, colour = "black") +
geom_point(data = av_soc_male, aes(x = soc_num, y = mn_fit),
size = 3, colour = "black") +
scale_x_continuous(breaks = c(1,1.23), labels = c("Social", "Solitary"),
limits = c(0.9, 1.33)) +
scale_y_continuous(breaks = seq(0,150, by = 30),
labels = seq(0,150, by = 30),
limits = c(0,150)) +
labs(x = "Sociality",
y = "Faecal cortisol metabolite\nconcentration ng/g",
tag = "a)") +
theme_bw(base_size = 16) +
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank())
head(cort_female)
imm_female_aug_plot <- imm_female_aug %>%
mutate(imm_num = if_else(immature_present == "Present", 1, 1.23))
av_imm_female <- imm_female_aug_plot %>%
group_by(sociality) %>%
summarise(mn_raw = mean(cort),
mn_fit = mean(exp(.fitted)),
se_raw = sd(cort)/sqrt(n()),
se_fit = sd(exp(.fitted))/sqrt(n()),
imm_num = soc_num[1],
imm_start = soc_num[1] - 0.08,
imm_end = soc_num[1] + 0.08)
imm_female_aug_plot <- imm_female_aug %>%
mutate(imm_num = if_else(immature_present == "Present", 1, 1.23))
av_imm_female <- imm_female_aug_plot %>%
group_by(sociality) %>%
summarise(mn_raw = mean(cort),
mn_fit = mean(exp(.fitted)),
se_raw = sd(cort)/sqrt(n()),
se_fit = sd(exp(.fitted))/sqrt(n()),
imm_num = imm_num[1],
imm_start = imm_num[1] - 0.08,
imm_end = imm_num[1] + 0.08)
ggplot(imm_female_aug_plot, aes(x = imm_num, y = cort)) +
geom_jitter(width = 0.1, size = 4,
alpha = 0.5, colour = "lightskyblue") +
geom_segment(data = av_imm_female, aes(x = imm_start, xend = imm_end,
y = mn_raw, yend = mn_raw)) +
geom_errorbar(data = av_imm_female, aes(ymax = mn_fit + se_fit,
ymin = mn_fit - se_fit, y = NULL),
width = 0.025, colour = "black") +
geom_point(data = av_imm_female, aes(x = imm_num, y = mn_fit),
size = 3, colour = "black") +
scale_x_continuous(breaks = c(1,1.23), labels = c("Social", "Solitary"),
limits = c(0.9, 1.33)) +
scale_y_continuous(breaks = seq(0,150, by = 30),
labels = seq(0,150, by = 30),
limits = c(0,150)) +
labs(x = "Sociality",
y = "Faecal cortisol metabolite\nconcentration ng/g",
tag = "a)") +
theme_bw(base_size = 16) +
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank())
imm_female_aug_plot <- imm_female_aug %>%
mutate(imm_num = if_else(immature_present == "Present", 1, 1.23))
av_imm_female <- imm_female_aug_plot %>%
group_by(immature_present) %>%
summarise(mn_raw = mean(cort),
mn_fit = mean(exp(.fitted)),
se_raw = sd(cort)/sqrt(n()),
se_fit = sd(exp(.fitted))/sqrt(n()),
imm_num = imm_num[1],
imm_start = imm_num[1] - 0.08,
imm_end = imm_num[1] + 0.08)
table(cort_female$immature_present)
imm_female_aug_plot <- imm_female_aug %>%
mutate(imm_num = if_else(immature_present == "Present", 1, 1.23))
av_imm_female <- imm_female_aug_plot %>%
group_by(immature_present) %>%
summarise(mn_raw = mean(cort),
mn_fit = mean(exp(.fitted)),
se_raw = sd(cort)/sqrt(n()),
se_fit = sd(exp(.fitted))/sqrt(n()),
imm_num = imm_num[1],
imm_start = imm_num[1] - 0.08,
imm_end = imm_num[1] + 0.08)
ggplot(imm_female_aug_plot, aes(x = imm_num, y = cort)) +
geom_jitter(width = 0.1, size = 4,
alpha = 0.5, colour = "lightskyblue") +
geom_segment(data = av_imm_female, aes(x = imm_start, xend = imm_end,
y = mn_raw, yend = mn_raw)) +
geom_errorbar(data = av_imm_female, aes(ymax = mn_fit + se_fit,
ymin = mn_fit - se_fit, y = NULL),
width = 0.025, colour = "black") +
geom_point(data = av_imm_female, aes(x = imm_num, y = mn_fit),
size = 3, colour = "black") +
scale_x_continuous(breaks = c(1,1.23), labels = c("SAbsent", "Present"),
limits = c(0.9, 1.33)) +
scale_y_continuous(breaks = seq(0,150, by = 30),
labels = seq(0,150, by = 30),
limits = c(0,150)) +
labs(x = "Immature elephant",
y = "Faecal cortisol metabolite\nconcentration ng/g",
tag = "a)") +
theme_bw(base_size = 16) +
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank())
imm_female_aug_plot <- imm_female_aug %>%
mutate(imm_num = if_else(immature_present == "Absent", 1, 1.23))
av_imm_female <- imm_female_aug_plot %>%
group_by(immature_present) %>%
summarise(mn_raw = mean(cort),
mn_fit = mean(exp(.fitted)),
se_raw = sd(cort)/sqrt(n()),
se_fit = sd(exp(.fitted))/sqrt(n()),
imm_num = imm_num[1],
imm_start = imm_num[1] - 0.08,
imm_end = imm_num[1] + 0.08)
ggplot(imm_female_aug_plot, aes(x = imm_num, y = cort)) +
geom_jitter(width = 0.1, size = 4,
alpha = 0.5, colour = "lightskyblue") +
geom_segment(data = av_imm_female, aes(x = imm_start, xend = imm_end,
y = mn_raw, yend = mn_raw)) +
geom_errorbar(data = av_imm_female, aes(ymax = mn_fit + se_fit,
ymin = mn_fit - se_fit, y = NULL),
width = 0.025, colour = "black") +
geom_point(data = av_imm_female, aes(x = imm_num, y = mn_fit),
size = 3, colour = "black") +
scale_x_continuous(breaks = c(1,1.23), labels = c("Absent", "Present"),
limits = c(0.9, 1.33)) +
scale_y_continuous(breaks = seq(0,150, by = 30),
labels = seq(0,150, by = 30),
limits = c(0,150)) +
labs(x = "Immature elephant",
y = "Faecal cortisol metabolite\nconcentration ng/g",
tag = "a)") +
theme_bw(base_size = 16) +
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank())
exp(0.02)
require(devtools)
devtools::install_github('hunzikp/velox')
require(devtools)
devtools::install_github('hunzikp/velox')
require(devtools)
devtools::install_github('hunzikp/velox')
install.packages("sf")
install.packages("libproj")
install.packages("rgdal")
install.packages("rgeos")
install.packages("sf")
install.packages('velox')
install.packages("sf")
library(devtools)
install_github("r-spatial/sf")
library(devtools)
install_github("r-spatial/sf")
install.packages("sf")
install.packages("sf")
devtools::install_github('hunzikp/velox')
devtools::install_github('hunzikp/velox')
install.packages('velox')
R.version.string
load("Elephant_population_dynamics/Demographic_drivers/Demography_manuscript/JAE/Revisions/Jackson_etal_analyses/Jackson_etal_simulationdata.RData")
knitr::opts_chunk$set(echo = TRUE)
## Summarising the simulation results
coef_sum <- coef_sim %>%
group_by(year, term) %>%
summarise(mn_cont = mean(cont),
lwr = quantile(cont, 0.05),
upr = quantile(cont, 0.95))
library(tidyverse)
coef_sum <- coef_sim %>%
group_by(year, term) %>%
summarise(mn_cont = mean(cont),
lwr = quantile(cont, 0.05),
upr = quantile(cont, 0.95))
AD_sum <- AD_sim %>%
mutate(param_comb = paste0(A_text,":",N_text)) %>%
group_by(year,param_comb) %>%
summarise(lwr = quantile(log(lambda_realised), 0.05),
upr = quantile(log(lambda_realised), 0.95)) %>%
filter(param_comb %in% c("At:Nt", "A_av:N_av") == T)
coef_sum_pf <- coef_sim_pf %>%
mutate(term = as.character(term)) %>%
group_by(year, term) %>%
summarise(mn_cont = mean(cont),
lwr = quantile(cont, 0.05),
upr = quantile(cont, 0.95)) %>%
filter(term != "N")
save(AD_sum, coef_sum, coef_sum_pf, file = "Elephant_population_dynamics/Demographic_drivers/Demography_manuscript/JAE/Revisions/Jackson_etal_analyses/Jackson_etal_simulationdata.RData")
setwd("~/Dropbox/Elephant_population_dynamics/Demographic_drivers/Demography_manuscript/JAE/Revisions/Jackson_etal_analyses")
load("Jackson_etal_data.RData", verbose = TRUE)
load("Jackson_etal_simulationdata.RData", verbose = TRUE)
glimpse(AD_sum)
glimpse(coef_sum)
glimpse(coef_sum_pf)
