Install necessary packages and import appropriate data
pacman::p_load(tidyverse, readxl, raster, vegan, tigris, sf, sjPlot, sp, spOccupancy, ggrepel, lme4, lmerTest, MuMIn, brms, MCMCvis)
# Tree PCQ Data
tree_data <- read_excel("C:/Users/alanivory34428/OneDrive - University of Florida/Desktop/School/PHD/01_Projects/05_SharedData/Field_Data_FL_AL_MS.xlsx",
sheet = "Tree_PCQ")
# Soil Data
fuel_data <- read_excel("C:/Users/alanivory34428/OneDrive - University of Florida/Desktop/School/PHD/01_Projects/05_SharedData/Field_Data_FL_AL_MS.xlsx",
sheet = "Fuel_Sampling")
# Veg Data
Veg_Cover <- read_excel("C:/Users/alanivory34428/OneDrive - University of Florida/Desktop/School/PHD/01_Projects/05_SharedData/Field_Data_FL_AL_MS.xlsx",
sheet = "Veg_Cover")
# Shrub Cover Data
shrub_data <- read_excel("C:/Users/alanivory34428/OneDrive - University of Florida/Desktop/School/PHD/01_Projects/05_SharedData/Field_Data_FL_AL_MS.xlsx",
sheet = "Shrub_Cover")
# Site Data
CameraData <- read_excel("C:/Users/alanivory34428/OneDrive - University of Florida/Desktop/School/PHD/01_Projects/04_Wildlife/02_Data/CameraData.xlsx")
CameraLoc <- read_excel("C:/Users/alanivory34428/OneDrive - University of Florida/Desktop/School/PHD/01_Projects/04_Wildlife/02_Data/CameraLoc.xlsx",
sheet = "CameraLocations")
# Add effort data
effort_matrix <- read_excel("C:/Users/alanivory34428/OneDrive - University of Florida/Desktop/School/PHD/01_Projects/04_Wildlife/02_Data/CameraLoc.xlsx",
sheet = "Effort_Matrix_Full") %>%
pivot_longer(cols = matches("^202[4-5]-"), names_to = "week", values_to = "days") %>%
filter(days == "7") %>%
dplyr::select(Plot, week)
I moved this from a later section because the filtering process removed quadrats that did not capture any species. Rows labeled as “None” were removed, suggesting that the number of quadrats sampled per plot is not consistent across all plots.
# Count the total number of quadrats per plot
quadrat_count <- Veg_Cover %>%
group_by(Plot) %>%
summarize(total_quadrats = n_distinct(Quadrat), .groups = "drop")
#Filter tree data to only include trees with "tree" in the growth column
tree_data <- dplyr::filter(tree_data, Growth == "Tree")
#Filter Veg Cover to exclude Shrubs and Trees
Veg_Cover <- dplyr::filter(Veg_Cover, Growth != "Shrub" & Growth != "Tree")
#Filter Shrub Cover to only include Shrubs and Trees
shrub_data <- dplyr::filter(shrub_data, Growth == "Shrub" | Growth == "Tree")
# Calculate the total number of sites
total_sites <- nrow(CameraLoc)
# Function to filter data by frequency
filter_by_frequency <- function(df) {
# Group data by species and calculate the frequency
freq <- df %>%
group_by(Species) %>%
summarise(Frequency = n_distinct(Plot) / nrow(CameraLoc) * 100) %>%
filter(Frequency >= 3)
# Filter the original data to include only species with frequency >= 3%
filtered_df <- df %>%
filter(Species %in% freq$Species)
return(filtered_df)
}
# Filter tree data by frequency
tree_data <- filter_by_frequency(tree_data)
# Filter Veg Cover data by frequency
Veg_Cover <- filter_by_frequency(Veg_Cover)
# Filter Shrub Cover data by frequency
shrub_data <- filter_by_frequency(shrub_data)
# Total length of Shrub cover at a site
shrub_cover <- shrub_data %>%
mutate(Cover = Line_End - Line_Start) %>%
group_by(Species_Name, Plot) %>%
summarise(Shrub_Total_Cover = sum(Cover, na.rm = TRUE), .groups = "drop") %>%
mutate(Shrub_Percent_Cover = Shrub_Total_Cover / 3000 * 100)
# Summed length of shrub over at a site
shrub_cover_summed <- shrub_cover %>%
group_by(Plot) %>%
summarize(total_shrub_cover = sum(Shrub_Total_Cover, na.rm = TRUE), .groups = "drop")
# Combine Plot and Quadrat columns
Veg_Cover <- Veg_Cover %>%
mutate(Plot_Quadrat = paste(Plot, Quadrat, sep = '_'))
# Join with CogonSites to get site information
Veg_Cover <- Veg_Cover %>%
left_join(CameraLoc, by = "Plot")
# Sum species cover across quadrats for each species at each plot
veg_cover_summed <- Veg_Cover %>%
group_by(Plot, Species_Name) %>%
summarize(total_cover = sum(Cover_Per, na.rm = TRUE), .groups = "drop")
# Calculate average herbaceous species cover
avg_species_cover <- veg_cover_summed %>%
left_join(quadrat_count, by = "Plot") %>%
mutate(avg_cover = total_cover / total_quadrats)
This species matrix includes herbaceous and shrub species
# Merge shrub cover with herbaceous average cover
combined_cover <- avg_species_cover %>%
full_join(
shrub_cover %>%
dplyr::select(Plot, Species_Name, Shrub_Percent_Cover),
by = c("Plot", "Species_Name")
) %>%
mutate(
overlap_flag = ifelse(!is.na(avg_cover) & !is.na(Shrub_Percent_Cover), TRUE, FALSE), # Flag overlaps
final_cover = case_when(
!is.na(avg_cover) & is.na(Shrub_Percent_Cover) ~ avg_cover, # Use herbaceous cover if no shrub data
is.na(avg_cover) & !is.na(Shrub_Percent_Cover) ~ Shrub_Percent_Cover, # Use shrub cover if no herbaceous data
TRUE ~ NA_real_ # Leave as NA where overlaps exist
)
)
# Species Matrix
species_matrix <- combined_cover %>%
dplyr::select(Plot, Species_Name, final_cover) %>%
pivot_wider(
names_from = Species_Name,
values_from = final_cover,
values_fill = 0
)
avg_cogongrass_cover <- species_matrix %>%
group_by(Plot) %>%
summarize(Avg_Cogongrass_Cover = sum(Imperata_cylindrica, na.rm = TRUE) / n(), .groups = "drop")
# Summarize species cover by site
site_species_cover <- Veg_Cover %>%
group_by(Plot, Species_Name) %>%
summarize(total_cover = sum(Cover_Per, na.rm = TRUE)) %>%
ungroup()
## `summarise()` has grouped output by 'Plot'. You can override using the
## `.groups` argument.
# Calculate Shannon diversity per site
Veg_shannon_diversity <- site_species_cover %>%
group_by(Plot) %>%
mutate(proportion = total_cover / sum(total_cover)) %>%
summarize(Veg_shannon_index = -sum(proportion * log(proportion), na.rm = TRUE))
print(Veg_shannon_diversity)
## # A tibble: 174 × 2
## Plot Veg_shannon_index
## <chr> <dbl>
## 1 BI200 2.28
## 2 BI201 2.20
## 3 BI202 1.50
## 4 BI97 1.82
## 5 BI99 3.06
## 6 BN210 2.97
## 7 BN211 2.43
## 8 BN212 2.22
## 9 BN96 3.05
## 10 BN98 2.79
## # ℹ 164 more rows
if (!is.numeric(fuel_data$Height)) {
fuel_data$Height <- as.numeric(as.character(fuel_data$Height))
}
## Warning: NAs introduced by coercion
# Calculate average vegetation height per plot
veg_height <- fuel_data %>%
group_by(Plot) %>%
summarize(avg_veg_height = mean(Height, na.rm = TRUE), .groups = "drop")
# Tree density from point-centered quarter data
if (!is.numeric(tree_data$Distance)) {
tree_data$Distance <- as.numeric(as.character(tree_data$Distance))
}
tree_density_data <- tree_data %>%
group_by(Plot) %>%
summarize(Average_Distance = mean(Distance) / 100, # Convert to meters
Tree_Density = 10000 / (Average_Distance^2)) # Convert to trees per hectare
# Average canopy cover from vegetation quadrats
tree_canopy_data <- Veg_Cover %>%
distinct(Plot, Quadrat, .keep_all = TRUE) %>% # Ensure each quadrat counts once per plot
group_by(Plot) %>%
summarize(Avg_Canopy_Cover = mean(Canopy_Cover, na.rm = TRUE), .groups = "drop") # Calculate the average canopy cover per plot
cor(tree_density_data$Tree_Density, tree_canopy_data$Avg_Canopy_Cover)
## [1] 0.2836106
CameraLoc <- CameraLoc %>%
left_join(Veg_shannon_diversity, by = "Plot") %>%
left_join(avg_cogongrass_cover, by = "Plot") %>%
left_join(shrub_cover_summed %>% dplyr::select(Plot, total_shrub_cover), by = "Plot") %>%
left_join(veg_height, by = "Plot") %>%
left_join(tree_density_data %>% dplyr::select(Plot, Tree_Density), by = "Plot") %>%
left_join(tree_canopy_data %>% dplyr::select(Plot, Avg_Canopy_Cover), by = "Plot") %>%
dplyr::select(-Authority)
# Group by Name and count the number of observations
species_counts <- CameraData %>%
filter(Class == "Mammalia") %>%
group_by(Name) %>%
summarize(count = n(), .groups = "drop")
# Filter for species with count greater than 50
species_subset <- species_counts %>%
filter(count > 2) %>%
pull(Name)
# Filter CameraData to only include species with count > 50
CameraData <- CameraData %>%
filter(Name %in% species_subset)
# Format Data Weekly
observations_weekly <- CameraData %>%
group_by(Plot, week = format(as.Date(Date), "%Y-%U"), Name) %>%
summarise(observations = n(), .groups = 'drop')
# Merge with Effort Matrix to include only valid weeks
observations_weekly <- effort_matrix %>%
left_join(observations_weekly, by = c("Plot" = "Plot", "week")) %>%
replace_na(list(observations = 0))
# Convert to wide format
observations_species <- observations_weekly %>%
pivot_wider(names_from = Name, values_from = observations, values_fill = list(observations = 0)) %>%
dplyr::select(-"NA")
# Create detection array
site_names <- sort(unique(observations_species$Plot))
species_names <- setdiff(colnames(observations_species), c("Plot", "week"))
num_sites <- length(site_names)
num_weeks <- length(unique(observations_species$week))
num_species <- length(species_names)
detection_array <- array(0, dim = c(num_sites, num_weeks, num_species))
dimnames(detection_array) <- list(site_names, unique(observations_species$week), species_names)
for (s in seq_along(species_names)) {
species_col <- species_names[s]
for (i in seq_along(site_names)) {
site <- site_names[i]
for (j in seq_along(unique(observations_species$week))) {
week <- unique(observations_species$week)[j]
detection_array[i, j, s] <- ifelse(
any(observations_species$Plot == site & observations_species$week == week & observations_species[[species_col]] > 0),
1, 0
)
}
}
}
dim(detection_array) # Should be num_sites x num_weeks x num_species
## [1] 32 36 11
# Duplicate CameraLoc to be used in Objective 2
CameraLoc_O2 <- CameraLoc
# Standardize the covariates
CameraLoc <- CameraLoc %>%
dplyr::select(-Plot, -Camera, -Lat, -Long, -Status, - Start_Date)
covariates_matrix <- as.matrix(CameraLoc)
rownames(covariates_matrix) <- site_names
# Standardizing covariates
covariates_matrix <- scale(covariates_matrix)
# Create week matrix for covariate structure [site x week]
week_vals <- unique(observations_species$week)
week_matrix <- matrix(rep(week_vals, each = num_sites), nrow = num_sites, ncol = num_weeks, byrow = FALSE)
# Create detection covariate list
det.covs <- list(
shrub_cover = covariates_matrix[, "total_shrub_cover"],
veg_height = covariates_matrix[, "avg_veg_height"],
week = week_matrix
)
# Remove dash and convert to numeric
week_numeric <- as.numeric(gsub("-", "", det.covs$week))
## Scale and center week_numeric
week_numeric <- scale(week_numeric)
# Reshape into the original 32x36 matrix
det.covs$week <- matrix(week_numeric, nrow = 32, ncol = 36)
str(det.covs)
## List of 3
## $ shrub_cover: Named num [1:32] 1.526 0.5 -0.153 -1.003 -0.811 ...
## ..- attr(*, "names")= chr [1:32] "BI201" "BN211" "EI100" "EI102" ...
## $ veg_height : Named num [1:32] 0.466 -1.044 1.181 0.879 1.684 ...
## ..- attr(*, "names")= chr [1:32] "BI201" "BN211" "EI100" "EI102" ...
## $ week : num [1:32, 1:36] -0.613 -0.613 -0.613 -0.613 -0.613 ...
This requires combining the presence data and the site covariate data into a single list. This also means that the presence data is in a 3-d format.
# Combine into a named list
data_list <- list(
y = detection_array,
occ.covs = covariates_matrix,
det.covs = det.covs
)
str(data_list)
## List of 3
## $ y : num [1:32, 1:36, 1:11] 1 1 0 1 0 0 0 1 0 0 ...
## ..- attr(*, "dimnames")=List of 3
## .. ..$ : chr [1:32] "BI201" "BN211" "EI100" "EI102" ...
## .. ..$ : chr [1:36] "2024-29" "2024-30" "2024-31" "2024-32" ...
## .. ..$ : chr [1:11] "Odocoileus_virginianus" "Canis_latrans" "Sciurus_niger" "Procyon_lotor" ...
## $ occ.covs: num [1:32, 1:10] -0.237 -0.446 -0.337 -0.308 0.039 ...
## ..- attr(*, "dimnames")=List of 2
## .. ..$ : chr [1:32] "BI201" "BN211" "EI100" "EI102" ...
## .. ..$ : chr [1:10] "Cogon_Patch_Size" "VegetationDiversity" "PostTreatmentDensities" "Auth" ...
## ..- attr(*, "scaled:center")= Named num [1:10] 458.388 21.875 0.898 2.844 2.264 ...
## .. ..- attr(*, "names")= chr [1:10] "Cogon_Patch_Size" "VegetationDiversity" "PostTreatmentDensities" "Auth" ...
## ..- attr(*, "scaled:scale")= Named num [1:10] 1027.633 6.871 1.232 0.808 0.459 ...
## .. ..- attr(*, "names")= chr [1:10] "Cogon_Patch_Size" "VegetationDiversity" "PostTreatmentDensities" "Auth" ...
## $ det.covs:List of 3
## ..$ shrub_cover: Named num [1:32] 1.526 0.5 -0.153 -1.003 -0.811 ...
## .. ..- attr(*, "names")= chr [1:32] "BI201" "BN211" "EI100" "EI102" ...
## ..$ veg_height : Named num [1:32] 0.466 -1.044 1.181 0.879 1.684 ...
## .. ..- attr(*, "names")= chr [1:32] "BI201" "BN211" "EI100" "EI102" ...
## ..$ week : num [1:32, 1:36] -0.613 -0.613 -0.613 -0.613 -0.613 ...
I am unsure why I only had an issue with total shrub cover, but this should fix the “cannot find” issue.
# Convert occupancy and detection covariates to a dataframe
data_list[["occ.covs"]] <- as.data.frame(data_list[["occ.covs"]])
data_list[["occ.covs"]]$total_shrub_cover <- as.numeric(data_list[["occ.covs"]]$total_shrub_cover)
#data_list[["det.covs"]] <- as.data.frame(data_list[["det.covs"]])
#data_list[["det.covs"]]$total_shrub_cover <- as.numeric(data_list[["det.covs"]]$total_shrub_cover)
# Make species the first dimension
data_list$y <- aperm(data_list$y, c(3, 1, 2))
dimnames(data_list$y) <- list(species = dimnames(data_list$y)[[1]],
site = dimnames(data_list$y)[[2]],
week = dimnames(data_list$y)[[3]])
str(data_list)
## List of 3
## $ y : num [1:11, 1:32, 1:36] 1 0 0 0 0 0 0 0 0 0 ...
## ..- attr(*, "dimnames")=List of 3
## .. ..$ species: chr [1:11] "Odocoileus_virginianus" "Canis_latrans" "Sciurus_niger" "Procyon_lotor" ...
## .. ..$ site : chr [1:32] "BI201" "BN211" "EI100" "EI102" ...
## .. ..$ week : chr [1:36] "2024-29" "2024-30" "2024-31" "2024-32" ...
## $ occ.covs:'data.frame': 32 obs. of 10 variables:
## ..$ Cogon_Patch_Size : num [1:32] -0.237 -0.446 -0.337 -0.308 0.039 ...
## ..$ VegetationDiversity : num [1:32] -0.273 0.455 1.619 -0.273 2.929 ...
## ..$ PostTreatmentDensities: num [1:32] 0.432 -0.729 0.432 2.169 1.13 ...
## ..$ Auth : num [1:32] -2.28 -2.28 -1.04 -1.04 -1.04 ...
## ..$ Veg_shannon_index : num [1:32] -0.143 0.359 0.604 -1.683 0.328 ...
## ..$ Avg_Cogongrass_Cover : num [1:32] -0.154 -0.708 0.308 2.045 1.121 ...
## ..$ total_shrub_cover : num [1:32] 1.526 0.5 -0.153 -1.003 -0.811 ...
## ..$ avg_veg_height : num [1:32] 0.466 -1.044 1.181 0.879 1.684 ...
## ..$ Tree_Density : num [1:32] -0.3629 -0.3564 -0.5111 3.5896 0.0958 ...
## ..$ Avg_Canopy_Cover : num [1:32] 0.1362 -0.0252 -0.9132 0.782 -1.9627 ...
## $ det.covs:List of 3
## ..$ shrub_cover: Named num [1:32] 1.526 0.5 -0.153 -1.003 -0.811 ...
## .. ..- attr(*, "names")= chr [1:32] "BI201" "BN211" "EI100" "EI102" ...
## ..$ veg_height : Named num [1:32] 0.466 -1.044 1.181 0.879 1.684 ...
## .. ..- attr(*, "names")= chr [1:32] "BI201" "BN211" "EI100" "EI102" ...
## ..$ week : num [1:32, 1:36] -0.613 -0.613 -0.613 -0.613 -0.613 ...
I have another document where I try each arrangement of these candidate models.
# Define detection formulas
det.null <- ~ 1
det.full <- ~ shrub_cover + veg_height + week
det.cover <- ~ shrub_cover + veg_height
det.week <- ~ week
det.week.quad <- ~ week + I(week^2)
det.full.quad <- ~ shrub_cover + veg_height + week + I(week^2)
# Define occupancy formulas
occ.null <- ~ 1
occ.full <- ~ Cogon_Patch_Size + Veg_shannon_index + total_shrub_cover + Avg_Cogongrass_Cover +
Tree_Density + Avg_Canopy_Cover + avg_veg_height + (1 | Auth)
occ.full.quad <- ~ Cogon_Patch_Size + Veg_shannon_index + total_shrub_cover + Avg_Cogongrass_Cover +
Tree_Density + Avg_Canopy_Cover + I(Avg_Cogongrass_Cover^2) + avg_veg_height + (1 | Auth)
occ.cover <- ~ Avg_Cogongrass_Cover + total_shrub_cover + avg_veg_height + (1 | Auth)
occ.canopy <- ~ Tree_Density + Avg_Canopy_Cover + (1 | Auth)
occ.move <- ~ Cogon_Patch_Size + Avg_Cogongrass_Cover + total_shrub_cover + (1 | Auth)
occ.forage <- ~ Veg_shannon_index + Avg_Cogongrass_Cover + (1 | Auth)
occ.cogon <- ~ Avg_Cogongrass_Cover + (1 | Auth)
occ.cogon.quad <- ~ Avg_Cogongrass_Cover + I(Avg_Cogongrass_Cover^2) + (1 | Auth)
Brief summary of results below: The quadratic of week of sampling had a significant negative effect on detection probability (posterior mean does not overlap zero). At the community level, vegetation diversity, the quadratic of average cogongrass cover, and canopy cover had positive effects on occupancy, while tree density had a negative effect. There are species specific responses to each of these covariates, such as coyotes having higher occupancy probabilities near larger cogongrass patches, but I won’t dive into that for right now, for the sake of this being a quick overview.
# Includes quadratic week and full covariates of detection and all covariates and quadratic cogon for occupancy
ms_fullQ_fullQ<- msPGOcc(
occ.formula = occ.full.quad,
det.formula = det.full.quad,
data = data_list,
n.samples = 5000,
n.thin = 4,
n.burn = 3000,
n.chains = 3,
n.report = 500,
)
## ----------------------------------------
## Preparing to run the model
## ----------------------------------------
## Warning in (function (..., row.names = NULL, check.rows = FALSE, check.names =
## TRUE, : row names were found from a short variable and have been discarded
## No prior specified for beta.comm.normal.
## Setting prior mean to 0 and prior variance to 2.72
## No prior specified for alpha.comm.normal.
## Setting prior mean to 0 and prior variance to 2.72
## No prior specified for tau.sq.beta.ig.
## Setting prior shape to 0.1 and prior scale to 0.1
## No prior specified for tau.sq.alpha.ig.
## Setting prior shape to 0.1 and prior scale to 0.1
## No prior specified for sigma.sq.psi.ig.
## Setting prior shape to 0.1 and prior scale to 0.1
## z is not specified in initial values.
## Setting initial values based on observed data
## beta.comm is not specified in initial values.
## Setting initial values to random values from the prior distribution
## alpha.comm is not specified in initial values.
## Setting initial values to random values from the prior distribution
## tau.sq.beta is not specified in initial values.
## Setting initial values to random values between 0.5 and 10
## tau.sq.alpha is not specified in initial values.
## Setting to initial values to random values between 0.5 and 10
## beta is not specified in initial values.
## Setting initial values to random values from the community-level normal distribution
## alpha is not specified in initial values.
## Setting initial values to random values from the community-level normal distribution
## sigma.sq.psi is not specified in initial values.
## Setting initial values to random values between 0.5 and 10
## ----------------------------------------
## Model description
## ----------------------------------------
## Multi-species Occupancy Model with Polya-Gamma latent
## variable fit with 32 sites and 11 species.
##
## Samples per Chain: 5000
## Burn-in: 3000
## Thinning Rate: 4
## Number of Chains: 3
## Total Posterior Samples: 1500
##
## Source compiled with OpenMP support and model fit using 1 thread(s).
##
## ----------------------------------------
## Chain 1
## ----------------------------------------
## Sampling ...
## Sampled: 500 of 5000, 10.00%
## -------------------------------------------------
## Sampled: 1000 of 5000, 20.00%
## -------------------------------------------------
## Sampled: 1500 of 5000, 30.00%
## -------------------------------------------------
## Sampled: 2000 of 5000, 40.00%
## -------------------------------------------------
## Sampled: 2500 of 5000, 50.00%
## -------------------------------------------------
## Sampled: 3000 of 5000, 60.00%
## -------------------------------------------------
## Sampled: 3500 of 5000, 70.00%
## -------------------------------------------------
## Sampled: 4000 of 5000, 80.00%
## -------------------------------------------------
## Sampled: 4500 of 5000, 90.00%
## -------------------------------------------------
## Sampled: 5000 of 5000, 100.00%
## ----------------------------------------
## Chain 2
## ----------------------------------------
## Sampling ...
## Sampled: 500 of 5000, 10.00%
## -------------------------------------------------
## Sampled: 1000 of 5000, 20.00%
## -------------------------------------------------
## Sampled: 1500 of 5000, 30.00%
## -------------------------------------------------
## Sampled: 2000 of 5000, 40.00%
## -------------------------------------------------
## Sampled: 2500 of 5000, 50.00%
## -------------------------------------------------
## Sampled: 3000 of 5000, 60.00%
## -------------------------------------------------
## Sampled: 3500 of 5000, 70.00%
## -------------------------------------------------
## Sampled: 4000 of 5000, 80.00%
## -------------------------------------------------
## Sampled: 4500 of 5000, 90.00%
## -------------------------------------------------
## Sampled: 5000 of 5000, 100.00%
## ----------------------------------------
## Chain 3
## ----------------------------------------
## Sampling ...
## Sampled: 500 of 5000, 10.00%
## -------------------------------------------------
## Sampled: 1000 of 5000, 20.00%
## -------------------------------------------------
## Sampled: 1500 of 5000, 30.00%
## -------------------------------------------------
## Sampled: 2000 of 5000, 40.00%
## -------------------------------------------------
## Sampled: 2500 of 5000, 50.00%
## -------------------------------------------------
## Sampled: 3000 of 5000, 60.00%
## -------------------------------------------------
## Sampled: 3500 of 5000, 70.00%
## -------------------------------------------------
## Sampled: 4000 of 5000, 80.00%
## -------------------------------------------------
## Sampled: 4500 of 5000, 90.00%
## -------------------------------------------------
## Sampled: 5000 of 5000, 100.00%
summary(ms_fullQ_fullQ)
##
## Call:
## msPGOcc(occ.formula = occ.full.quad, det.formula = det.full.quad,
## data = data_list, n.samples = 5000, n.report = 500, n.burn = 3000,
## n.thin = 4, n.chains = 3)
##
## Samples per Chain: 5000
## Burn-in: 3000
## Thinning Rate: 4
## Number of Chains: 3
## Total Posterior Samples: 1500
## Run Time (min): 0.8157
##
## ----------------------------------------
## Community Level
## ----------------------------------------
## Occurrence Means (logit scale):
## Mean SD 2.5% 50% 97.5% Rhat ESS
## (Intercept) -0.8727 1.1925 -3.1557 -0.9228 1.5602 1.0043 428
## Cogon_Patch_Size 0.0610 0.7161 -1.3899 0.0900 1.3917 1.0134 347
## Veg_shannon_index 1.3534 0.6322 0.1633 1.3106 2.7013 1.0150 284
## total_shrub_cover -0.3872 0.5125 -1.4492 -0.3700 0.5512 1.0279 236
## Avg_Cogongrass_Cover 0.3430 0.9884 -1.5644 0.3485 2.1906 1.0073 114
## Tree_Density -1.8846 0.8490 -3.6116 -1.8755 -0.1742 1.0082 270
## Avg_Canopy_Cover 1.9846 0.7265 0.6699 1.9428 3.5951 1.0827 176
## I(Avg_Cogongrass_Cover^2) 1.6865 0.6041 0.5675 1.6675 2.9267 1.0452 145
## avg_veg_height -0.2146 0.5197 -1.1926 -0.1974 0.8332 1.0129 258
##
## Occurrence Variances (logit scale):
## Mean SD 2.5% 50% 97.5% Rhat ESS
## (Intercept) 24.2702 22.5819 4.0832 17.8872 87.6905 1.1573 113
## Cogon_Patch_Size 3.4054 5.1646 0.1595 1.8301 18.7924 1.1319 180
## Veg_shannon_index 1.3547 2.3636 0.0562 0.5461 7.5731 1.0248 162
## total_shrub_cover 0.7958 1.0995 0.0548 0.4446 3.6954 1.0270 198
## Avg_Cogongrass_Cover 1.1720 2.0279 0.0532 0.4794 6.5602 1.0665 331
## Tree_Density 5.0650 8.6841 0.0796 1.8087 30.8277 1.3910 70
## Avg_Canopy_Cover 3.4594 4.6931 0.1672 1.9679 17.1668 1.2927 126
## I(Avg_Cogongrass_Cover^2) 1.0225 1.7431 0.0464 0.4403 5.6336 1.0613 205
## avg_veg_height 0.5603 0.8410 0.0457 0.2884 2.7736 1.0218 410
##
## Occurrence Random Effect Variances (logit scale):
## Mean SD 2.5% 50% 97.5% Rhat ESS
## Auth 1.2537 1.5172 0.054 0.684 5.5799 1.2784 56
##
## Detection Means (logit scale):
## Mean SD 2.5% 50% 97.5% Rhat ESS
## (Intercept) -2.4612 0.4892 -3.4254 -2.4694 -1.4771 1.0012 1477
## shrub_cover 0.2916 0.2527 -0.1949 0.2877 0.8021 1.0057 838
## veg_height 0.0179 0.1555 -0.3008 0.0184 0.3200 1.0011 632
## week 0.3686 0.2266 -0.0923 0.3725 0.8220 1.0250 764
## I(week^2) -0.2820 0.1030 -0.4964 -0.2779 -0.0887 1.0216 683
##
## Detection Variances (logit scale):
## Mean SD 2.5% 50% 97.5% Rhat ESS
## (Intercept) 2.6499 1.6540 0.9040 2.2326 6.6985 1.0032 994
## shrub_cover 0.4970 0.4207 0.1107 0.3893 1.6220 1.0175 461
## veg_height 0.1939 0.1336 0.0554 0.1615 0.5121 1.0190 1101
## week 0.4401 0.3511 0.1032 0.3407 1.3889 1.0116 339
## I(week^2) 0.0726 0.0590 0.0216 0.0566 0.2122 1.0075 931
##
## ----------------------------------------
## Species Level
## ----------------------------------------
## Occurrence (logit scale):
## Mean SD 2.5%
## (Intercept)-Odocoileus_virginianus 8.0721 3.8678 2.7036
## (Intercept)-Canis_latrans -1.0418 1.4280 -3.5768
## (Intercept)-Sciurus_niger 1.1929 2.8653 -2.9846
## (Intercept)-Procyon_lotor -0.1399 1.3831 -2.3980
## (Intercept)-Dasypus_novemcinctus -2.7825 1.3126 -5.7223
## (Intercept)-Lynx_rufus 0.8252 2.5981 -3.1776
## (Intercept)-Didelphis_virginiana -4.2858 1.5636 -7.7737
## (Intercept)-Sylvilagus_floridanus -2.5508 1.5457 -6.0426
## (Intercept)-Sciurus_carolinensis -4.8849 1.6520 -8.6355
## (Intercept)-Vulpes_vulpes -4.0066 2.2240 -8.1363
## (Intercept)-Sus_scrofa -6.0561 2.3898 -11.8167
## Cogon_Patch_Size-Odocoileus_virginianus 0.2521 1.5171 -2.4811
## Cogon_Patch_Size-Canis_latrans 1.8295 1.5251 -0.1687
## Cogon_Patch_Size-Sciurus_niger -0.6483 2.0249 -5.2023
## Cogon_Patch_Size-Procyon_lotor -0.1041 0.7761 -1.5226
## Cogon_Patch_Size-Dasypus_novemcinctus 0.1797 0.7666 -1.3071
## Cogon_Patch_Size-Lynx_rufus -0.1581 1.5462 -3.4442
## Cogon_Patch_Size-Didelphis_virginiana 1.8687 1.0332 0.0137
## Cogon_Patch_Size-Sylvilagus_floridanus -0.9649 1.6242 -4.7817
## Cogon_Patch_Size-Sciurus_carolinensis -0.9569 1.4232 -4.3662
## Cogon_Patch_Size-Vulpes_vulpes -0.3258 1.6854 -3.5566
## Cogon_Patch_Size-Sus_scrofa -0.3625 1.5275 -4.0397
## Veg_shannon_index-Odocoileus_virginianus 1.1820 1.2014 -1.4817
## Veg_shannon_index-Canis_latrans 1.6692 0.9203 0.0120
## Veg_shannon_index-Sciurus_niger 1.7552 1.4461 -0.3574
## Veg_shannon_index-Procyon_lotor 1.4810 0.9374 0.0117
## Veg_shannon_index-Dasypus_novemcinctus 0.9290 0.7772 -0.7458
## Veg_shannon_index-Lynx_rufus 1.3424 1.2596 -0.8416
## Veg_shannon_index-Didelphis_virginiana 1.3305 0.9072 -0.3375
## Veg_shannon_index-Sylvilagus_floridanus 1.8300 1.0565 0.1840
## Veg_shannon_index-Sciurus_carolinensis 0.8945 0.9740 -1.3445
## Veg_shannon_index-Vulpes_vulpes 1.0632 1.0531 -1.2650
## Veg_shannon_index-Sus_scrofa 2.2657 1.3248 0.3872
## total_shrub_cover-Odocoileus_virginianus -0.1851 0.8884 -1.8334
## total_shrub_cover-Canis_latrans 0.1152 0.6697 -1.0013
## total_shrub_cover-Sciurus_niger -0.6336 1.0803 -3.0667
## total_shrub_cover-Procyon_lotor -0.9528 0.6781 -2.4807
## total_shrub_cover-Dasypus_novemcinctus -0.1518 0.6327 -1.4308
## total_shrub_cover-Lynx_rufus -0.6185 1.0950 -3.1383
## total_shrub_cover-Didelphis_virginiana -0.5893 0.7370 -2.3034
## total_shrub_cover-Sylvilagus_floridanus -0.4380 0.8486 -2.4146
## total_shrub_cover-Sciurus_carolinensis -0.3237 0.8095 -2.1687
## total_shrub_cover-Vulpes_vulpes -0.5605 0.8992 -2.8049
## total_shrub_cover-Sus_scrofa -0.1116 0.8240 -1.6865
## Avg_Cogongrass_Cover-Odocoileus_virginianus 0.2828 1.3975 -2.5732
## Avg_Cogongrass_Cover-Canis_latrans 0.5813 1.2111 -1.7537
## Avg_Cogongrass_Cover-Sciurus_niger -0.0311 1.6030 -3.7333
## Avg_Cogongrass_Cover-Procyon_lotor 0.5295 1.2095 -1.8222
## Avg_Cogongrass_Cover-Dasypus_novemcinctus 0.9528 1.2839 -1.4025
## Avg_Cogongrass_Cover-Lynx_rufus 0.3807 1.3385 -2.3931
## Avg_Cogongrass_Cover-Didelphis_virginiana 0.4223 1.2378 -2.1412
## Avg_Cogongrass_Cover-Sylvilagus_floridanus -0.1041 1.3010 -2.9251
## Avg_Cogongrass_Cover-Sciurus_carolinensis 0.3538 1.2759 -2.1688
## Avg_Cogongrass_Cover-Vulpes_vulpes 0.5579 1.3206 -1.8866
## Avg_Cogongrass_Cover-Sus_scrofa 0.1085 1.3419 -2.6614
## Tree_Density-Odocoileus_virginianus -0.8013 1.5558 -3.2295
## Tree_Density-Canis_latrans -2.7338 1.5155 -6.3121
## Tree_Density-Sciurus_niger -1.6184 1.8201 -5.2933
## Tree_Density-Procyon_lotor -1.8352 0.9700 -3.8316
## Tree_Density-Dasypus_novemcinctus -4.2990 2.6846 -11.7869
## Tree_Density-Lynx_rufus -0.4861 1.9383 -3.3174
## Tree_Density-Didelphis_virginiana -2.3216 1.4412 -5.8280
## Tree_Density-Sylvilagus_floridanus -2.6093 1.6178 -6.2674
## Tree_Density-Sciurus_carolinensis -2.7403 1.8219 -7.5309
## Tree_Density-Vulpes_vulpes -1.7693 2.0918 -6.0293
## Tree_Density-Sus_scrofa -2.6244 1.9915 -7.9248
## Avg_Canopy_Cover-Odocoileus_virginianus 1.3447 1.6396 -2.2321
## Avg_Canopy_Cover-Canis_latrans 0.1346 0.7441 -1.2924
## Avg_Canopy_Cover-Sciurus_niger 2.3852 1.9184 -0.8565
## Avg_Canopy_Cover-Procyon_lotor 1.6870 0.8814 0.2045
## Avg_Canopy_Cover-Dasypus_novemcinctus 2.2424 0.9886 0.7952
## Avg_Canopy_Cover-Lynx_rufus 1.8794 1.6511 -0.8777
## Avg_Canopy_Cover-Didelphis_virginiana 3.1545 1.3990 1.1911
## Avg_Canopy_Cover-Sylvilagus_floridanus 3.9523 2.0392 1.2756
## Avg_Canopy_Cover-Sciurus_carolinensis 2.8910 1.4526 0.9736
## Avg_Canopy_Cover-Vulpes_vulpes 2.8001 1.7968 0.4542
## Avg_Canopy_Cover-Sus_scrofa 2.1089 1.0727 0.4292
## I(Avg_Cogongrass_Cover^2)-Odocoileus_virginianus 1.9985 1.1727 0.1375
## I(Avg_Cogongrass_Cover^2)-Canis_latrans 2.1042 0.9845 0.6439
## I(Avg_Cogongrass_Cover^2)-Sciurus_niger 1.3530 1.1842 -1.2444
## I(Avg_Cogongrass_Cover^2)-Procyon_lotor 2.0839 0.9616 0.6092
## I(Avg_Cogongrass_Cover^2)-Dasypus_novemcinctus 1.6267 0.7679 0.3262
## I(Avg_Cogongrass_Cover^2)-Lynx_rufus 2.1775 1.0048 0.5360
## I(Avg_Cogongrass_Cover^2)-Didelphis_virginiana 1.3174 0.7440 -0.0263
## I(Avg_Cogongrass_Cover^2)-Sylvilagus_floridanus 1.4852 0.8639 -0.0251
## I(Avg_Cogongrass_Cover^2)-Sciurus_carolinensis 1.8439 0.8193 0.4674
## I(Avg_Cogongrass_Cover^2)-Vulpes_vulpes 2.0111 0.9167 0.5191
## I(Avg_Cogongrass_Cover^2)-Sus_scrofa 1.1828 1.1798 -1.7432
## avg_veg_height-Odocoileus_virginianus -0.2027 0.8275 -1.8354
## avg_veg_height-Canis_latrans -0.2997 0.6731 -1.6193
## avg_veg_height-Sciurus_niger -0.3571 0.9530 -2.4679
## avg_veg_height-Procyon_lotor -0.0025 0.6761 -1.3151
## avg_veg_height-Dasypus_novemcinctus 0.1250 0.6626 -1.1151
## avg_veg_height-Lynx_rufus -0.4194 0.8530 -2.2097
## avg_veg_height-Didelphis_virginiana -0.4671 0.7452 -2.0960
## avg_veg_height-Sylvilagus_floridanus -0.2451 0.7371 -1.7476
## avg_veg_height-Sciurus_carolinensis 0.1026 0.7090 -1.1291
## avg_veg_height-Vulpes_vulpes -0.3203 0.8575 -2.0644
## avg_veg_height-Sus_scrofa -0.2538 0.7567 -1.8559
## 50% 97.5% Rhat ESS
## (Intercept)-Odocoileus_virginianus 7.3451 17.6524 1.1300 99
## (Intercept)-Canis_latrans -1.1092 1.4404 1.1222 204
## (Intercept)-Sciurus_niger 0.6969 8.2687 1.0445 107
## (Intercept)-Procyon_lotor -0.2361 2.4895 1.1273 143
## (Intercept)-Dasypus_novemcinctus -2.6269 -0.5669 1.1072 236
## (Intercept)-Lynx_rufus 0.4471 6.9197 1.0615 104
## (Intercept)-Didelphis_virginiana -4.1531 -1.6268 1.0745 179
## (Intercept)-Sylvilagus_floridanus -2.4298 0.0900 1.0942 213
## (Intercept)-Sciurus_carolinensis -4.7606 -2.1133 1.1094 94
## (Intercept)-Vulpes_vulpes -4.0639 0.6934 1.0804 143
## (Intercept)-Sus_scrofa -5.7317 -2.4016 1.1025 202
## Cogon_Patch_Size-Odocoileus_virginianus 0.1647 3.3818 1.0566 458
## Cogon_Patch_Size-Canis_latrans 1.5195 5.8149 1.0863 258
## Cogon_Patch_Size-Sciurus_niger -0.4487 2.8393 1.0416 123
## Cogon_Patch_Size-Procyon_lotor -0.1222 1.3224 1.0240 334
## Cogon_Patch_Size-Dasypus_novemcinctus 0.1731 1.6923 1.0106 522
## Cogon_Patch_Size-Lynx_rufus -0.1788 3.0240 1.0293 140
## Cogon_Patch_Size-Didelphis_virginiana 1.8030 4.1036 1.0905 263
## Cogon_Patch_Size-Sylvilagus_floridanus -0.6734 1.3150 1.1006 239
## Cogon_Patch_Size-Sciurus_carolinensis -0.6959 1.0457 1.0372 303
## Cogon_Patch_Size-Vulpes_vulpes -0.2922 2.8660 1.0644 270
## Cogon_Patch_Size-Sus_scrofa -0.1350 2.0104 1.0004 280
## Veg_shannon_index-Odocoileus_virginianus 1.2141 3.4746 1.0267 569
## Veg_shannon_index-Canis_latrans 1.5841 3.7905 1.0766 295
## Veg_shannon_index-Sciurus_niger 1.5333 5.3395 1.0090 167
## Veg_shannon_index-Procyon_lotor 1.3634 3.5955 1.1049 139
## Veg_shannon_index-Dasypus_novemcinctus 0.9419 2.4342 1.0056 624
## Veg_shannon_index-Lynx_rufus 1.2986 3.7254 1.0442 298
## Veg_shannon_index-Didelphis_virginiana 1.3194 3.2049 1.0320 301
## Veg_shannon_index-Sylvilagus_floridanus 1.6666 4.2793 1.0160 196
## Veg_shannon_index-Sciurus_carolinensis 0.9398 2.7525 1.0025 476
## Veg_shannon_index-Vulpes_vulpes 1.0763 3.1739 1.0129 464
## Veg_shannon_index-Sus_scrofa 2.0272 5.4434 1.0334 176
## total_shrub_cover-Odocoileus_virginianus -0.2370 1.7202 1.0172 638
## total_shrub_cover-Canis_latrans 0.0517 1.6536 1.0177 439
## total_shrub_cover-Sciurus_niger -0.4980 1.1268 1.0232 144
## total_shrub_cover-Procyon_lotor -0.9065 0.2030 1.0049 380
## total_shrub_cover-Dasypus_novemcinctus -0.1257 1.0034 1.0128 558
## total_shrub_cover-Lynx_rufus -0.4959 1.4237 1.0361 212
## total_shrub_cover-Didelphis_virginiana -0.5239 0.6965 1.0044 593
## total_shrub_cover-Sylvilagus_floridanus -0.3552 1.0512 1.0261 342
## total_shrub_cover-Sciurus_carolinensis -0.2941 1.2373 1.0120 364
## total_shrub_cover-Vulpes_vulpes -0.4819 1.0242 1.0031 297
## total_shrub_cover-Sus_scrofa -0.1326 1.6946 1.0091 498
## Avg_Cogongrass_Cover-Odocoileus_virginianus 0.3347 2.8014 1.0046 211
## Avg_Cogongrass_Cover-Canis_latrans 0.5580 3.0066 1.0063 206
## Avg_Cogongrass_Cover-Sciurus_niger 0.1193 2.6787 1.0084 178
## Avg_Cogongrass_Cover-Procyon_lotor 0.5267 2.9072 1.0076 174
## Avg_Cogongrass_Cover-Dasypus_novemcinctus 0.8962 3.8530 1.0252 234
## Avg_Cogongrass_Cover-Lynx_rufus 0.4038 2.9158 1.0143 204
## Avg_Cogongrass_Cover-Didelphis_virginiana 0.4303 2.9666 1.0083 213
## Avg_Cogongrass_Cover-Sylvilagus_floridanus -0.0126 2.2747 1.0123 175
## Avg_Cogongrass_Cover-Sciurus_carolinensis 0.3586 2.8061 1.0083 174
## Avg_Cogongrass_Cover-Vulpes_vulpes 0.5491 3.2472 1.0188 150
## Avg_Cogongrass_Cover-Sus_scrofa 0.1884 2.5160 1.0257 177
## Tree_Density-Odocoileus_virginianus -0.9955 3.2002 1.0790 257
## Tree_Density-Canis_latrans -2.4292 -0.5405 1.0925 143
## Tree_Density-Sciurus_niger -1.6274 2.2792 1.0151 195
## Tree_Density-Procyon_lotor -1.7825 -0.0990 1.0121 344
## Tree_Density-Dasypus_novemcinctus -3.5344 -1.3292 1.2617 98
## Tree_Density-Lynx_rufus -0.8902 4.9017 1.1600 138
## Tree_Density-Didelphis_virginiana -2.1569 -0.0018 1.0557 217
## Tree_Density-Sylvilagus_floridanus -2.3580 0.0469 1.0761 262
## Tree_Density-Sciurus_carolinensis -2.4046 -0.0442 1.1520 114
## Tree_Density-Vulpes_vulpes -1.8765 3.0372 1.0730 171
## Tree_Density-Sus_scrofa -2.1953 0.3045 1.1604 195
## Avg_Canopy_Cover-Odocoileus_virginianus 1.4035 4.7067 1.0454 477
## Avg_Canopy_Cover-Canis_latrans 0.1191 1.6413 1.0604 149
## Avg_Canopy_Cover-Sciurus_niger 2.1440 7.1715 1.1025 186
## Avg_Canopy_Cover-Procyon_lotor 1.6106 3.6281 1.0481 356
## Avg_Canopy_Cover-Dasypus_novemcinctus 2.0573 4.7030 1.1799 106
## Avg_Canopy_Cover-Lynx_rufus 1.7095 5.6648 1.0417 195
## Avg_Canopy_Cover-Didelphis_virginiana 2.8489 6.5206 1.2148 112
## Avg_Canopy_Cover-Sylvilagus_floridanus 3.5369 9.1010 1.2598 84
## Avg_Canopy_Cover-Sciurus_carolinensis 2.5565 6.6553 1.1143 113
## Avg_Canopy_Cover-Vulpes_vulpes 2.3863 7.4542 1.1815 165
## Avg_Canopy_Cover-Sus_scrofa 1.9793 4.7549 1.0869 204
## I(Avg_Cogongrass_Cover^2)-Odocoileus_virginianus 1.8369 4.8984 1.0062 197
## I(Avg_Cogongrass_Cover^2)-Canis_latrans 1.9586 4.4770 1.0377 128
## I(Avg_Cogongrass_Cover^2)-Sciurus_niger 1.3761 3.6758 1.0369 159
## I(Avg_Cogongrass_Cover^2)-Procyon_lotor 1.9850 4.3357 1.0699 202
## I(Avg_Cogongrass_Cover^2)-Dasypus_novemcinctus 1.5506 3.3274 1.0531 246
## I(Avg_Cogongrass_Cover^2)-Lynx_rufus 2.0495 4.5648 1.0024 200
## I(Avg_Cogongrass_Cover^2)-Didelphis_virginiana 1.2944 2.8185 1.0324 142
## I(Avg_Cogongrass_Cover^2)-Sylvilagus_floridanus 1.4337 3.3532 1.0440 250
## I(Avg_Cogongrass_Cover^2)-Sciurus_carolinensis 1.7692 3.6062 1.0406 117
## I(Avg_Cogongrass_Cover^2)-Vulpes_vulpes 1.8980 4.0534 1.0163 185
## I(Avg_Cogongrass_Cover^2)-Sus_scrofa 1.2962 3.1293 1.0002 195
## avg_veg_height-Odocoileus_virginianus -0.1750 1.3486 1.0055 542
## avg_veg_height-Canis_latrans -0.2888 0.9827 1.0175 415
## avg_veg_height-Sciurus_niger -0.2947 1.3076 1.0262 224
## avg_veg_height-Procyon_lotor 0.0041 1.3287 1.0075 483
## avg_veg_height-Dasypus_novemcinctus 0.0917 1.5206 1.0114 324
## avg_veg_height-Lynx_rufus -0.3836 1.2091 1.0230 376
## avg_veg_height-Didelphis_virginiana -0.4177 0.8800 1.0138 371
## avg_veg_height-Sylvilagus_floridanus -0.2341 1.3120 1.0097 382
## avg_veg_height-Sciurus_carolinensis 0.0645 1.5650 1.0058 529
## avg_veg_height-Vulpes_vulpes -0.2828 1.2883 1.0154 372
## avg_veg_height-Sus_scrofa -0.2368 1.1799 1.0042 392
##
## Detection (logit scale):
## Mean SD 2.5% 50% 97.5%
## (Intercept)-Odocoileus_virginianus 0.5372 0.0799 0.3849 0.5358 0.6960
## (Intercept)-Canis_latrans -2.5148 0.1970 -2.9182 -2.5098 -2.1629
## (Intercept)-Sciurus_niger -4.7140 0.5826 -5.8973 -4.7130 -3.5720
## (Intercept)-Procyon_lotor -2.2045 0.1699 -2.5516 -2.1994 -1.8887
## (Intercept)-Dasypus_novemcinctus -1.5996 0.1849 -1.9623 -1.5919 -1.2486
## (Intercept)-Lynx_rufus -3.7369 0.3887 -4.4873 -3.7317 -2.9568
## (Intercept)-Didelphis_virginiana -2.3466 0.3181 -2.9710 -2.3522 -1.7396
## (Intercept)-Sylvilagus_floridanus -3.0668 0.2965 -3.6764 -3.0537 -2.5280
## (Intercept)-Sciurus_carolinensis -2.4753 0.3418 -3.2019 -2.4569 -1.8568
## (Intercept)-Vulpes_vulpes -4.1287 0.6889 -5.6119 -4.1127 -2.8805
## (Intercept)-Sus_scrofa -3.0824 0.6078 -4.2043 -3.0933 -1.8539
## shrub_cover-Odocoileus_virginianus -0.0598 0.0677 -0.1866 -0.0606 0.0781
## shrub_cover-Canis_latrans -0.2635 0.2231 -0.7015 -0.2652 0.1674
## shrub_cover-Sciurus_niger -0.3394 0.4283 -1.2331 -0.3186 0.4470
## shrub_cover-Procyon_lotor 0.2636 0.1676 -0.0736 0.2712 0.5826
## shrub_cover-Dasypus_novemcinctus 0.8751 0.3071 0.2866 0.8709 1.4778
## shrub_cover-Lynx_rufus -0.2190 0.3540 -0.9353 -0.2129 0.4795
## shrub_cover-Didelphis_virginiana 0.9378 0.3677 0.2800 0.9141 1.7002
## shrub_cover-Sylvilagus_floridanus 0.4634 0.3748 -0.2639 0.4501 1.2457
## shrub_cover-Sciurus_carolinensis 0.8748 0.4088 0.1049 0.8656 1.7225
## shrub_cover-Vulpes_vulpes 0.1115 0.5402 -0.9708 0.1178 1.1588
## shrub_cover-Sus_scrofa 0.5855 0.7293 -0.7860 0.5451 2.0840
## veg_height-Odocoileus_virginianus -0.3273 0.0690 -0.4713 -0.3269 -0.1961
## veg_height-Canis_latrans -0.5386 0.1781 -0.8819 -0.5325 -0.2002
## veg_height-Sciurus_niger -0.0399 0.3652 -0.7671 -0.0392 0.7055
## veg_height-Procyon_lotor 0.3550 0.1269 0.1028 0.3555 0.5972
## veg_height-Dasypus_novemcinctus 0.2447 0.1379 -0.0135 0.2387 0.5300
## veg_height-Lynx_rufus 0.1397 0.2271 -0.2986 0.1374 0.5759
## veg_height-Didelphis_virginiana 0.4284 0.2406 -0.0423 0.4282 0.9209
## veg_height-Sylvilagus_floridanus 0.1296 0.2393 -0.3492 0.1280 0.6021
## veg_height-Sciurus_carolinensis 0.1000 0.2166 -0.2953 0.0904 0.5512
## veg_height-Vulpes_vulpes -0.1581 0.3120 -0.8081 -0.1438 0.4121
## veg_height-Sus_scrofa -0.1190 0.3219 -0.7783 -0.1089 0.4781
## week-Odocoileus_virginianus 1.3060 0.1256 1.0666 1.3000 1.5575
## week-Canis_latrans 0.5848 0.2651 0.0903 0.5745 1.1650
## week-Sciurus_niger -0.4050 0.5626 -1.6374 -0.3431 0.5698
## week-Procyon_lotor 0.2058 0.2107 -0.2237 0.2060 0.6154
## week-Dasypus_novemcinctus 0.1098 0.2241 -0.3345 0.1138 0.5470
## week-Lynx_rufus 0.3892 0.3445 -0.2895 0.3853 1.0386
## week-Didelphis_virginiana 0.0773 0.3748 -0.7065 0.0931 0.7675
## week-Sylvilagus_floridanus 0.0744 0.3448 -0.5908 0.0788 0.7495
## week-Sciurus_carolinensis 0.7998 0.3528 0.1556 0.7836 1.5347
## week-Vulpes_vulpes 0.2247 0.5343 -0.9326 0.2594 1.1630
## week-Sus_scrofa 0.6869 0.4487 -0.1510 0.6584 1.5988
## I(week^2)-Odocoileus_virginianus -0.5386 0.0516 -0.6383 -0.5393 -0.4378
## I(week^2)-Canis_latrans -0.2416 0.1078 -0.4565 -0.2373 -0.0349
## I(week^2)-Sciurus_niger -0.2924 0.2434 -0.8258 -0.2796 0.1510
## I(week^2)-Procyon_lotor -0.1371 0.0933 -0.3141 -0.1337 0.0451
## I(week^2)-Dasypus_novemcinctus -0.1819 0.1010 -0.3851 -0.1821 0.0079
## I(week^2)-Lynx_rufus -0.2434 0.1547 -0.5663 -0.2413 0.0503
## I(week^2)-Didelphis_virginiana -0.4084 0.2153 -0.9279 -0.3858 -0.0523
## I(week^2)-Sylvilagus_floridanus -0.1827 0.1563 -0.5026 -0.1749 0.1156
## I(week^2)-Sciurus_carolinensis -0.2856 0.1415 -0.5787 -0.2846 -0.0178
## I(week^2)-Vulpes_vulpes -0.3882 0.2388 -0.9331 -0.3737 0.0355
## I(week^2)-Sus_scrofa -0.2347 0.1769 -0.5744 -0.2329 0.0956
## Rhat ESS
## (Intercept)-Odocoileus_virginianus 1.0005 1500
## (Intercept)-Canis_latrans 1.0265 441
## (Intercept)-Sciurus_niger 1.0455 133
## (Intercept)-Procyon_lotor 1.0241 641
## (Intercept)-Dasypus_novemcinctus 1.0013 1146
## (Intercept)-Lynx_rufus 1.0664 200
## (Intercept)-Didelphis_virginiana 1.0299 721
## (Intercept)-Sylvilagus_floridanus 1.0014 723
## (Intercept)-Sciurus_carolinensis 1.0093 615
## (Intercept)-Vulpes_vulpes 1.0403 134
## (Intercept)-Sus_scrofa 1.0241 566
## shrub_cover-Odocoileus_virginianus 1.0026 1500
## shrub_cover-Canis_latrans 1.0005 608
## shrub_cover-Sciurus_niger 1.0269 320
## shrub_cover-Procyon_lotor 1.0411 281
## shrub_cover-Dasypus_novemcinctus 1.0086 695
## shrub_cover-Lynx_rufus 1.0122 323
## shrub_cover-Didelphis_virginiana 1.0209 521
## shrub_cover-Sylvilagus_floridanus 1.0171 522
## shrub_cover-Sciurus_carolinensis 1.0033 395
## shrub_cover-Vulpes_vulpes 1.0084 500
## shrub_cover-Sus_scrofa 1.0116 607
## veg_height-Odocoileus_virginianus 1.0057 1500
## veg_height-Canis_latrans 1.0050 780
## veg_height-Sciurus_niger 1.0044 215
## veg_height-Procyon_lotor 1.0086 917
## veg_height-Dasypus_novemcinctus 1.0004 1300
## veg_height-Lynx_rufus 1.0450 558
## veg_height-Didelphis_virginiana 1.0022 870
## veg_height-Sylvilagus_floridanus 1.0052 834
## veg_height-Sciurus_carolinensis 1.0147 641
## veg_height-Vulpes_vulpes 1.0159 724
## veg_height-Sus_scrofa 1.0189 783
## week-Odocoileus_virginianus 1.0017 1500
## week-Canis_latrans 1.0005 1249
## week-Sciurus_niger 1.0351 102
## week-Procyon_lotor 1.0015 1004
## week-Dasypus_novemcinctus 1.0024 1111
## week-Lynx_rufus 1.0052 774
## week-Didelphis_virginiana 1.0155 906
## week-Sylvilagus_floridanus 1.0261 670
## week-Sciurus_carolinensis 1.0074 1030
## week-Vulpes_vulpes 1.0373 424
## week-Sus_scrofa 1.0172 1086
## I(week^2)-Odocoileus_virginianus 0.9995 1500
## I(week^2)-Canis_latrans 1.0104 1148
## I(week^2)-Sciurus_niger 1.0114 150
## I(week^2)-Procyon_lotor 1.0018 1152
## I(week^2)-Dasypus_novemcinctus 1.0158 1254
## I(week^2)-Lynx_rufus 1.0039 441
## I(week^2)-Didelphis_virginiana 1.0146 479
## I(week^2)-Sylvilagus_floridanus 1.0000 749
## I(week^2)-Sciurus_carolinensis 1.0043 1099
## I(week^2)-Vulpes_vulpes 1.0389 518
## I(week^2)-Sus_scrofa 1.0097 1281
Of all of the canidate models, this one had the lowest WAIC value and was the most parsimonious. If interested, I can share the other script. I simply thought this was the simpliest way to share the data.
waicOcc(ms_fullQ_fullQ, by.sp = FALSE)
## elpd pD WAIC
## -1684.226 139.090 3646.632
This test explains how well the model fits that data at the community and species level. I believe 0.5 is the target p-value, though how far from this number is considered adequate, I do not know yet. I believe this is a good place to check when thinking about which species we include in the model (currently set at mammals with > 2 occurences).
ppc.ms_fullQ_fullQ <- ppcOcc(ms_fullQ_fullQ, fit.stat = "freeman-tukey", group = 1)
## Currently on species 1 out of 11
## Currently on species 2 out of 11
## Currently on species 3 out of 11
## Currently on species 4 out of 11
## Currently on species 5 out of 11
## Currently on species 6 out of 11
## Currently on species 7 out of 11
## Currently on species 8 out of 11
## Currently on species 9 out of 11
## Currently on species 10 out of 11
## Currently on species 11 out of 11
summary(ppc.ms_fullQ_fullQ)
##
## Call:
## ppcOcc(object = ms_fullQ_fullQ, fit.stat = "freeman-tukey", group = 1)
##
## Samples per Chain: 5000
## Burn-in: 3000
## Thinning Rate: 4
## Number of Chains: 3
## Total Posterior Samples: 1500
##
## ----------------------------------------
## Community Level
## ----------------------------------------
## Bayesian p-value: 0.303
##
## ----------------------------------------
## Species Level
## ----------------------------------------
## Odocoileus_virginianus Bayesian p-value: 0
## Canis_latrans Bayesian p-value: 0.6553
## Sciurus_niger Bayesian p-value: 0.114
## Procyon_lotor Bayesian p-value: 0.0667
## Dasypus_novemcinctus Bayesian p-value: 0
## Lynx_rufus Bayesian p-value: 0.298
## Didelphis_virginiana Bayesian p-value: 0.4453
## Sylvilagus_floridanus Bayesian p-value: 0.4273
## Sciurus_carolinensis Bayesian p-value: 0.4153
## Vulpes_vulpes Bayesian p-value: 0.2847
## Sus_scrofa Bayesian p-value: 0.626
## Fit statistic: freeman-tukey
I would like to plot these at the species level as well, as there is a great bit of uncertainty. Also, technically the quadratic of cogon is significant, not the linear. The plot below is just to show the framework of how I can plot each variable at the community level.
summary(ms_fullQ_fullQ) # Summary of parameter estimates
##
## Call:
## msPGOcc(occ.formula = occ.full.quad, det.formula = det.full.quad,
## data = data_list, n.samples = 5000, n.report = 500, n.burn = 3000,
## n.thin = 4, n.chains = 3)
##
## Samples per Chain: 5000
## Burn-in: 3000
## Thinning Rate: 4
## Number of Chains: 3
## Total Posterior Samples: 1500
## Run Time (min): 0.8157
##
## ----------------------------------------
## Community Level
## ----------------------------------------
## Occurrence Means (logit scale):
## Mean SD 2.5% 50% 97.5% Rhat ESS
## (Intercept) -0.8727 1.1925 -3.1557 -0.9228 1.5602 1.0043 428
## Cogon_Patch_Size 0.0610 0.7161 -1.3899 0.0900 1.3917 1.0134 347
## Veg_shannon_index 1.3534 0.6322 0.1633 1.3106 2.7013 1.0150 284
## total_shrub_cover -0.3872 0.5125 -1.4492 -0.3700 0.5512 1.0279 236
## Avg_Cogongrass_Cover 0.3430 0.9884 -1.5644 0.3485 2.1906 1.0073 114
## Tree_Density -1.8846 0.8490 -3.6116 -1.8755 -0.1742 1.0082 270
## Avg_Canopy_Cover 1.9846 0.7265 0.6699 1.9428 3.5951 1.0827 176
## I(Avg_Cogongrass_Cover^2) 1.6865 0.6041 0.5675 1.6675 2.9267 1.0452 145
## avg_veg_height -0.2146 0.5197 -1.1926 -0.1974 0.8332 1.0129 258
##
## Occurrence Variances (logit scale):
## Mean SD 2.5% 50% 97.5% Rhat ESS
## (Intercept) 24.2702 22.5819 4.0832 17.8872 87.6905 1.1573 113
## Cogon_Patch_Size 3.4054 5.1646 0.1595 1.8301 18.7924 1.1319 180
## Veg_shannon_index 1.3547 2.3636 0.0562 0.5461 7.5731 1.0248 162
## total_shrub_cover 0.7958 1.0995 0.0548 0.4446 3.6954 1.0270 198
## Avg_Cogongrass_Cover 1.1720 2.0279 0.0532 0.4794 6.5602 1.0665 331
## Tree_Density 5.0650 8.6841 0.0796 1.8087 30.8277 1.3910 70
## Avg_Canopy_Cover 3.4594 4.6931 0.1672 1.9679 17.1668 1.2927 126
## I(Avg_Cogongrass_Cover^2) 1.0225 1.7431 0.0464 0.4403 5.6336 1.0613 205
## avg_veg_height 0.5603 0.8410 0.0457 0.2884 2.7736 1.0218 410
##
## Occurrence Random Effect Variances (logit scale):
## Mean SD 2.5% 50% 97.5% Rhat ESS
## Auth 1.2537 1.5172 0.054 0.684 5.5799 1.2784 56
##
## Detection Means (logit scale):
## Mean SD 2.5% 50% 97.5% Rhat ESS
## (Intercept) -2.4612 0.4892 -3.4254 -2.4694 -1.4771 1.0012 1477
## shrub_cover 0.2916 0.2527 -0.1949 0.2877 0.8021 1.0057 838
## veg_height 0.0179 0.1555 -0.3008 0.0184 0.3200 1.0011 632
## week 0.3686 0.2266 -0.0923 0.3725 0.8220 1.0250 764
## I(week^2) -0.2820 0.1030 -0.4964 -0.2779 -0.0887 1.0216 683
##
## Detection Variances (logit scale):
## Mean SD 2.5% 50% 97.5% Rhat ESS
## (Intercept) 2.6499 1.6540 0.9040 2.2326 6.6985 1.0032 994
## shrub_cover 0.4970 0.4207 0.1107 0.3893 1.6220 1.0175 461
## veg_height 0.1939 0.1336 0.0554 0.1615 0.5121 1.0190 1101
## week 0.4401 0.3511 0.1032 0.3407 1.3889 1.0116 339
## I(week^2) 0.0726 0.0590 0.0216 0.0566 0.2122 1.0075 931
##
## ----------------------------------------
## Species Level
## ----------------------------------------
## Occurrence (logit scale):
## Mean SD 2.5%
## (Intercept)-Odocoileus_virginianus 8.0721 3.8678 2.7036
## (Intercept)-Canis_latrans -1.0418 1.4280 -3.5768
## (Intercept)-Sciurus_niger 1.1929 2.8653 -2.9846
## (Intercept)-Procyon_lotor -0.1399 1.3831 -2.3980
## (Intercept)-Dasypus_novemcinctus -2.7825 1.3126 -5.7223
## (Intercept)-Lynx_rufus 0.8252 2.5981 -3.1776
## (Intercept)-Didelphis_virginiana -4.2858 1.5636 -7.7737
## (Intercept)-Sylvilagus_floridanus -2.5508 1.5457 -6.0426
## (Intercept)-Sciurus_carolinensis -4.8849 1.6520 -8.6355
## (Intercept)-Vulpes_vulpes -4.0066 2.2240 -8.1363
## (Intercept)-Sus_scrofa -6.0561 2.3898 -11.8167
## Cogon_Patch_Size-Odocoileus_virginianus 0.2521 1.5171 -2.4811
## Cogon_Patch_Size-Canis_latrans 1.8295 1.5251 -0.1687
## Cogon_Patch_Size-Sciurus_niger -0.6483 2.0249 -5.2023
## Cogon_Patch_Size-Procyon_lotor -0.1041 0.7761 -1.5226
## Cogon_Patch_Size-Dasypus_novemcinctus 0.1797 0.7666 -1.3071
## Cogon_Patch_Size-Lynx_rufus -0.1581 1.5462 -3.4442
## Cogon_Patch_Size-Didelphis_virginiana 1.8687 1.0332 0.0137
## Cogon_Patch_Size-Sylvilagus_floridanus -0.9649 1.6242 -4.7817
## Cogon_Patch_Size-Sciurus_carolinensis -0.9569 1.4232 -4.3662
## Cogon_Patch_Size-Vulpes_vulpes -0.3258 1.6854 -3.5566
## Cogon_Patch_Size-Sus_scrofa -0.3625 1.5275 -4.0397
## Veg_shannon_index-Odocoileus_virginianus 1.1820 1.2014 -1.4817
## Veg_shannon_index-Canis_latrans 1.6692 0.9203 0.0120
## Veg_shannon_index-Sciurus_niger 1.7552 1.4461 -0.3574
## Veg_shannon_index-Procyon_lotor 1.4810 0.9374 0.0117
## Veg_shannon_index-Dasypus_novemcinctus 0.9290 0.7772 -0.7458
## Veg_shannon_index-Lynx_rufus 1.3424 1.2596 -0.8416
## Veg_shannon_index-Didelphis_virginiana 1.3305 0.9072 -0.3375
## Veg_shannon_index-Sylvilagus_floridanus 1.8300 1.0565 0.1840
## Veg_shannon_index-Sciurus_carolinensis 0.8945 0.9740 -1.3445
## Veg_shannon_index-Vulpes_vulpes 1.0632 1.0531 -1.2650
## Veg_shannon_index-Sus_scrofa 2.2657 1.3248 0.3872
## total_shrub_cover-Odocoileus_virginianus -0.1851 0.8884 -1.8334
## total_shrub_cover-Canis_latrans 0.1152 0.6697 -1.0013
## total_shrub_cover-Sciurus_niger -0.6336 1.0803 -3.0667
## total_shrub_cover-Procyon_lotor -0.9528 0.6781 -2.4807
## total_shrub_cover-Dasypus_novemcinctus -0.1518 0.6327 -1.4308
## total_shrub_cover-Lynx_rufus -0.6185 1.0950 -3.1383
## total_shrub_cover-Didelphis_virginiana -0.5893 0.7370 -2.3034
## total_shrub_cover-Sylvilagus_floridanus -0.4380 0.8486 -2.4146
## total_shrub_cover-Sciurus_carolinensis -0.3237 0.8095 -2.1687
## total_shrub_cover-Vulpes_vulpes -0.5605 0.8992 -2.8049
## total_shrub_cover-Sus_scrofa -0.1116 0.8240 -1.6865
## Avg_Cogongrass_Cover-Odocoileus_virginianus 0.2828 1.3975 -2.5732
## Avg_Cogongrass_Cover-Canis_latrans 0.5813 1.2111 -1.7537
## Avg_Cogongrass_Cover-Sciurus_niger -0.0311 1.6030 -3.7333
## Avg_Cogongrass_Cover-Procyon_lotor 0.5295 1.2095 -1.8222
## Avg_Cogongrass_Cover-Dasypus_novemcinctus 0.9528 1.2839 -1.4025
## Avg_Cogongrass_Cover-Lynx_rufus 0.3807 1.3385 -2.3931
## Avg_Cogongrass_Cover-Didelphis_virginiana 0.4223 1.2378 -2.1412
## Avg_Cogongrass_Cover-Sylvilagus_floridanus -0.1041 1.3010 -2.9251
## Avg_Cogongrass_Cover-Sciurus_carolinensis 0.3538 1.2759 -2.1688
## Avg_Cogongrass_Cover-Vulpes_vulpes 0.5579 1.3206 -1.8866
## Avg_Cogongrass_Cover-Sus_scrofa 0.1085 1.3419 -2.6614
## Tree_Density-Odocoileus_virginianus -0.8013 1.5558 -3.2295
## Tree_Density-Canis_latrans -2.7338 1.5155 -6.3121
## Tree_Density-Sciurus_niger -1.6184 1.8201 -5.2933
## Tree_Density-Procyon_lotor -1.8352 0.9700 -3.8316
## Tree_Density-Dasypus_novemcinctus -4.2990 2.6846 -11.7869
## Tree_Density-Lynx_rufus -0.4861 1.9383 -3.3174
## Tree_Density-Didelphis_virginiana -2.3216 1.4412 -5.8280
## Tree_Density-Sylvilagus_floridanus -2.6093 1.6178 -6.2674
## Tree_Density-Sciurus_carolinensis -2.7403 1.8219 -7.5309
## Tree_Density-Vulpes_vulpes -1.7693 2.0918 -6.0293
## Tree_Density-Sus_scrofa -2.6244 1.9915 -7.9248
## Avg_Canopy_Cover-Odocoileus_virginianus 1.3447 1.6396 -2.2321
## Avg_Canopy_Cover-Canis_latrans 0.1346 0.7441 -1.2924
## Avg_Canopy_Cover-Sciurus_niger 2.3852 1.9184 -0.8565
## Avg_Canopy_Cover-Procyon_lotor 1.6870 0.8814 0.2045
## Avg_Canopy_Cover-Dasypus_novemcinctus 2.2424 0.9886 0.7952
## Avg_Canopy_Cover-Lynx_rufus 1.8794 1.6511 -0.8777
## Avg_Canopy_Cover-Didelphis_virginiana 3.1545 1.3990 1.1911
## Avg_Canopy_Cover-Sylvilagus_floridanus 3.9523 2.0392 1.2756
## Avg_Canopy_Cover-Sciurus_carolinensis 2.8910 1.4526 0.9736
## Avg_Canopy_Cover-Vulpes_vulpes 2.8001 1.7968 0.4542
## Avg_Canopy_Cover-Sus_scrofa 2.1089 1.0727 0.4292
## I(Avg_Cogongrass_Cover^2)-Odocoileus_virginianus 1.9985 1.1727 0.1375
## I(Avg_Cogongrass_Cover^2)-Canis_latrans 2.1042 0.9845 0.6439
## I(Avg_Cogongrass_Cover^2)-Sciurus_niger 1.3530 1.1842 -1.2444
## I(Avg_Cogongrass_Cover^2)-Procyon_lotor 2.0839 0.9616 0.6092
## I(Avg_Cogongrass_Cover^2)-Dasypus_novemcinctus 1.6267 0.7679 0.3262
## I(Avg_Cogongrass_Cover^2)-Lynx_rufus 2.1775 1.0048 0.5360
## I(Avg_Cogongrass_Cover^2)-Didelphis_virginiana 1.3174 0.7440 -0.0263
## I(Avg_Cogongrass_Cover^2)-Sylvilagus_floridanus 1.4852 0.8639 -0.0251
## I(Avg_Cogongrass_Cover^2)-Sciurus_carolinensis 1.8439 0.8193 0.4674
## I(Avg_Cogongrass_Cover^2)-Vulpes_vulpes 2.0111 0.9167 0.5191
## I(Avg_Cogongrass_Cover^2)-Sus_scrofa 1.1828 1.1798 -1.7432
## avg_veg_height-Odocoileus_virginianus -0.2027 0.8275 -1.8354
## avg_veg_height-Canis_latrans -0.2997 0.6731 -1.6193
## avg_veg_height-Sciurus_niger -0.3571 0.9530 -2.4679
## avg_veg_height-Procyon_lotor -0.0025 0.6761 -1.3151
## avg_veg_height-Dasypus_novemcinctus 0.1250 0.6626 -1.1151
## avg_veg_height-Lynx_rufus -0.4194 0.8530 -2.2097
## avg_veg_height-Didelphis_virginiana -0.4671 0.7452 -2.0960
## avg_veg_height-Sylvilagus_floridanus -0.2451 0.7371 -1.7476
## avg_veg_height-Sciurus_carolinensis 0.1026 0.7090 -1.1291
## avg_veg_height-Vulpes_vulpes -0.3203 0.8575 -2.0644
## avg_veg_height-Sus_scrofa -0.2538 0.7567 -1.8559
## 50% 97.5% Rhat ESS
## (Intercept)-Odocoileus_virginianus 7.3451 17.6524 1.1300 99
## (Intercept)-Canis_latrans -1.1092 1.4404 1.1222 204
## (Intercept)-Sciurus_niger 0.6969 8.2687 1.0445 107
## (Intercept)-Procyon_lotor -0.2361 2.4895 1.1273 143
## (Intercept)-Dasypus_novemcinctus -2.6269 -0.5669 1.1072 236
## (Intercept)-Lynx_rufus 0.4471 6.9197 1.0615 104
## (Intercept)-Didelphis_virginiana -4.1531 -1.6268 1.0745 179
## (Intercept)-Sylvilagus_floridanus -2.4298 0.0900 1.0942 213
## (Intercept)-Sciurus_carolinensis -4.7606 -2.1133 1.1094 94
## (Intercept)-Vulpes_vulpes -4.0639 0.6934 1.0804 143
## (Intercept)-Sus_scrofa -5.7317 -2.4016 1.1025 202
## Cogon_Patch_Size-Odocoileus_virginianus 0.1647 3.3818 1.0566 458
## Cogon_Patch_Size-Canis_latrans 1.5195 5.8149 1.0863 258
## Cogon_Patch_Size-Sciurus_niger -0.4487 2.8393 1.0416 123
## Cogon_Patch_Size-Procyon_lotor -0.1222 1.3224 1.0240 334
## Cogon_Patch_Size-Dasypus_novemcinctus 0.1731 1.6923 1.0106 522
## Cogon_Patch_Size-Lynx_rufus -0.1788 3.0240 1.0293 140
## Cogon_Patch_Size-Didelphis_virginiana 1.8030 4.1036 1.0905 263
## Cogon_Patch_Size-Sylvilagus_floridanus -0.6734 1.3150 1.1006 239
## Cogon_Patch_Size-Sciurus_carolinensis -0.6959 1.0457 1.0372 303
## Cogon_Patch_Size-Vulpes_vulpes -0.2922 2.8660 1.0644 270
## Cogon_Patch_Size-Sus_scrofa -0.1350 2.0104 1.0004 280
## Veg_shannon_index-Odocoileus_virginianus 1.2141 3.4746 1.0267 569
## Veg_shannon_index-Canis_latrans 1.5841 3.7905 1.0766 295
## Veg_shannon_index-Sciurus_niger 1.5333 5.3395 1.0090 167
## Veg_shannon_index-Procyon_lotor 1.3634 3.5955 1.1049 139
## Veg_shannon_index-Dasypus_novemcinctus 0.9419 2.4342 1.0056 624
## Veg_shannon_index-Lynx_rufus 1.2986 3.7254 1.0442 298
## Veg_shannon_index-Didelphis_virginiana 1.3194 3.2049 1.0320 301
## Veg_shannon_index-Sylvilagus_floridanus 1.6666 4.2793 1.0160 196
## Veg_shannon_index-Sciurus_carolinensis 0.9398 2.7525 1.0025 476
## Veg_shannon_index-Vulpes_vulpes 1.0763 3.1739 1.0129 464
## Veg_shannon_index-Sus_scrofa 2.0272 5.4434 1.0334 176
## total_shrub_cover-Odocoileus_virginianus -0.2370 1.7202 1.0172 638
## total_shrub_cover-Canis_latrans 0.0517 1.6536 1.0177 439
## total_shrub_cover-Sciurus_niger -0.4980 1.1268 1.0232 144
## total_shrub_cover-Procyon_lotor -0.9065 0.2030 1.0049 380
## total_shrub_cover-Dasypus_novemcinctus -0.1257 1.0034 1.0128 558
## total_shrub_cover-Lynx_rufus -0.4959 1.4237 1.0361 212
## total_shrub_cover-Didelphis_virginiana -0.5239 0.6965 1.0044 593
## total_shrub_cover-Sylvilagus_floridanus -0.3552 1.0512 1.0261 342
## total_shrub_cover-Sciurus_carolinensis -0.2941 1.2373 1.0120 364
## total_shrub_cover-Vulpes_vulpes -0.4819 1.0242 1.0031 297
## total_shrub_cover-Sus_scrofa -0.1326 1.6946 1.0091 498
## Avg_Cogongrass_Cover-Odocoileus_virginianus 0.3347 2.8014 1.0046 211
## Avg_Cogongrass_Cover-Canis_latrans 0.5580 3.0066 1.0063 206
## Avg_Cogongrass_Cover-Sciurus_niger 0.1193 2.6787 1.0084 178
## Avg_Cogongrass_Cover-Procyon_lotor 0.5267 2.9072 1.0076 174
## Avg_Cogongrass_Cover-Dasypus_novemcinctus 0.8962 3.8530 1.0252 234
## Avg_Cogongrass_Cover-Lynx_rufus 0.4038 2.9158 1.0143 204
## Avg_Cogongrass_Cover-Didelphis_virginiana 0.4303 2.9666 1.0083 213
## Avg_Cogongrass_Cover-Sylvilagus_floridanus -0.0126 2.2747 1.0123 175
## Avg_Cogongrass_Cover-Sciurus_carolinensis 0.3586 2.8061 1.0083 174
## Avg_Cogongrass_Cover-Vulpes_vulpes 0.5491 3.2472 1.0188 150
## Avg_Cogongrass_Cover-Sus_scrofa 0.1884 2.5160 1.0257 177
## Tree_Density-Odocoileus_virginianus -0.9955 3.2002 1.0790 257
## Tree_Density-Canis_latrans -2.4292 -0.5405 1.0925 143
## Tree_Density-Sciurus_niger -1.6274 2.2792 1.0151 195
## Tree_Density-Procyon_lotor -1.7825 -0.0990 1.0121 344
## Tree_Density-Dasypus_novemcinctus -3.5344 -1.3292 1.2617 98
## Tree_Density-Lynx_rufus -0.8902 4.9017 1.1600 138
## Tree_Density-Didelphis_virginiana -2.1569 -0.0018 1.0557 217
## Tree_Density-Sylvilagus_floridanus -2.3580 0.0469 1.0761 262
## Tree_Density-Sciurus_carolinensis -2.4046 -0.0442 1.1520 114
## Tree_Density-Vulpes_vulpes -1.8765 3.0372 1.0730 171
## Tree_Density-Sus_scrofa -2.1953 0.3045 1.1604 195
## Avg_Canopy_Cover-Odocoileus_virginianus 1.4035 4.7067 1.0454 477
## Avg_Canopy_Cover-Canis_latrans 0.1191 1.6413 1.0604 149
## Avg_Canopy_Cover-Sciurus_niger 2.1440 7.1715 1.1025 186
## Avg_Canopy_Cover-Procyon_lotor 1.6106 3.6281 1.0481 356
## Avg_Canopy_Cover-Dasypus_novemcinctus 2.0573 4.7030 1.1799 106
## Avg_Canopy_Cover-Lynx_rufus 1.7095 5.6648 1.0417 195
## Avg_Canopy_Cover-Didelphis_virginiana 2.8489 6.5206 1.2148 112
## Avg_Canopy_Cover-Sylvilagus_floridanus 3.5369 9.1010 1.2598 84
## Avg_Canopy_Cover-Sciurus_carolinensis 2.5565 6.6553 1.1143 113
## Avg_Canopy_Cover-Vulpes_vulpes 2.3863 7.4542 1.1815 165
## Avg_Canopy_Cover-Sus_scrofa 1.9793 4.7549 1.0869 204
## I(Avg_Cogongrass_Cover^2)-Odocoileus_virginianus 1.8369 4.8984 1.0062 197
## I(Avg_Cogongrass_Cover^2)-Canis_latrans 1.9586 4.4770 1.0377 128
## I(Avg_Cogongrass_Cover^2)-Sciurus_niger 1.3761 3.6758 1.0369 159
## I(Avg_Cogongrass_Cover^2)-Procyon_lotor 1.9850 4.3357 1.0699 202
## I(Avg_Cogongrass_Cover^2)-Dasypus_novemcinctus 1.5506 3.3274 1.0531 246
## I(Avg_Cogongrass_Cover^2)-Lynx_rufus 2.0495 4.5648 1.0024 200
## I(Avg_Cogongrass_Cover^2)-Didelphis_virginiana 1.2944 2.8185 1.0324 142
## I(Avg_Cogongrass_Cover^2)-Sylvilagus_floridanus 1.4337 3.3532 1.0440 250
## I(Avg_Cogongrass_Cover^2)-Sciurus_carolinensis 1.7692 3.6062 1.0406 117
## I(Avg_Cogongrass_Cover^2)-Vulpes_vulpes 1.8980 4.0534 1.0163 185
## I(Avg_Cogongrass_Cover^2)-Sus_scrofa 1.2962 3.1293 1.0002 195
## avg_veg_height-Odocoileus_virginianus -0.1750 1.3486 1.0055 542
## avg_veg_height-Canis_latrans -0.2888 0.9827 1.0175 415
## avg_veg_height-Sciurus_niger -0.2947 1.3076 1.0262 224
## avg_veg_height-Procyon_lotor 0.0041 1.3287 1.0075 483
## avg_veg_height-Dasypus_novemcinctus 0.0917 1.5206 1.0114 324
## avg_veg_height-Lynx_rufus -0.3836 1.2091 1.0230 376
## avg_veg_height-Didelphis_virginiana -0.4177 0.8800 1.0138 371
## avg_veg_height-Sylvilagus_floridanus -0.2341 1.3120 1.0097 382
## avg_veg_height-Sciurus_carolinensis 0.0645 1.5650 1.0058 529
## avg_veg_height-Vulpes_vulpes -0.2828 1.2883 1.0154 372
## avg_veg_height-Sus_scrofa -0.2368 1.1799 1.0042 392
##
## Detection (logit scale):
## Mean SD 2.5% 50% 97.5%
## (Intercept)-Odocoileus_virginianus 0.5372 0.0799 0.3849 0.5358 0.6960
## (Intercept)-Canis_latrans -2.5148 0.1970 -2.9182 -2.5098 -2.1629
## (Intercept)-Sciurus_niger -4.7140 0.5826 -5.8973 -4.7130 -3.5720
## (Intercept)-Procyon_lotor -2.2045 0.1699 -2.5516 -2.1994 -1.8887
## (Intercept)-Dasypus_novemcinctus -1.5996 0.1849 -1.9623 -1.5919 -1.2486
## (Intercept)-Lynx_rufus -3.7369 0.3887 -4.4873 -3.7317 -2.9568
## (Intercept)-Didelphis_virginiana -2.3466 0.3181 -2.9710 -2.3522 -1.7396
## (Intercept)-Sylvilagus_floridanus -3.0668 0.2965 -3.6764 -3.0537 -2.5280
## (Intercept)-Sciurus_carolinensis -2.4753 0.3418 -3.2019 -2.4569 -1.8568
## (Intercept)-Vulpes_vulpes -4.1287 0.6889 -5.6119 -4.1127 -2.8805
## (Intercept)-Sus_scrofa -3.0824 0.6078 -4.2043 -3.0933 -1.8539
## shrub_cover-Odocoileus_virginianus -0.0598 0.0677 -0.1866 -0.0606 0.0781
## shrub_cover-Canis_latrans -0.2635 0.2231 -0.7015 -0.2652 0.1674
## shrub_cover-Sciurus_niger -0.3394 0.4283 -1.2331 -0.3186 0.4470
## shrub_cover-Procyon_lotor 0.2636 0.1676 -0.0736 0.2712 0.5826
## shrub_cover-Dasypus_novemcinctus 0.8751 0.3071 0.2866 0.8709 1.4778
## shrub_cover-Lynx_rufus -0.2190 0.3540 -0.9353 -0.2129 0.4795
## shrub_cover-Didelphis_virginiana 0.9378 0.3677 0.2800 0.9141 1.7002
## shrub_cover-Sylvilagus_floridanus 0.4634 0.3748 -0.2639 0.4501 1.2457
## shrub_cover-Sciurus_carolinensis 0.8748 0.4088 0.1049 0.8656 1.7225
## shrub_cover-Vulpes_vulpes 0.1115 0.5402 -0.9708 0.1178 1.1588
## shrub_cover-Sus_scrofa 0.5855 0.7293 -0.7860 0.5451 2.0840
## veg_height-Odocoileus_virginianus -0.3273 0.0690 -0.4713 -0.3269 -0.1961
## veg_height-Canis_latrans -0.5386 0.1781 -0.8819 -0.5325 -0.2002
## veg_height-Sciurus_niger -0.0399 0.3652 -0.7671 -0.0392 0.7055
## veg_height-Procyon_lotor 0.3550 0.1269 0.1028 0.3555 0.5972
## veg_height-Dasypus_novemcinctus 0.2447 0.1379 -0.0135 0.2387 0.5300
## veg_height-Lynx_rufus 0.1397 0.2271 -0.2986 0.1374 0.5759
## veg_height-Didelphis_virginiana 0.4284 0.2406 -0.0423 0.4282 0.9209
## veg_height-Sylvilagus_floridanus 0.1296 0.2393 -0.3492 0.1280 0.6021
## veg_height-Sciurus_carolinensis 0.1000 0.2166 -0.2953 0.0904 0.5512
## veg_height-Vulpes_vulpes -0.1581 0.3120 -0.8081 -0.1438 0.4121
## veg_height-Sus_scrofa -0.1190 0.3219 -0.7783 -0.1089 0.4781
## week-Odocoileus_virginianus 1.3060 0.1256 1.0666 1.3000 1.5575
## week-Canis_latrans 0.5848 0.2651 0.0903 0.5745 1.1650
## week-Sciurus_niger -0.4050 0.5626 -1.6374 -0.3431 0.5698
## week-Procyon_lotor 0.2058 0.2107 -0.2237 0.2060 0.6154
## week-Dasypus_novemcinctus 0.1098 0.2241 -0.3345 0.1138 0.5470
## week-Lynx_rufus 0.3892 0.3445 -0.2895 0.3853 1.0386
## week-Didelphis_virginiana 0.0773 0.3748 -0.7065 0.0931 0.7675
## week-Sylvilagus_floridanus 0.0744 0.3448 -0.5908 0.0788 0.7495
## week-Sciurus_carolinensis 0.7998 0.3528 0.1556 0.7836 1.5347
## week-Vulpes_vulpes 0.2247 0.5343 -0.9326 0.2594 1.1630
## week-Sus_scrofa 0.6869 0.4487 -0.1510 0.6584 1.5988
## I(week^2)-Odocoileus_virginianus -0.5386 0.0516 -0.6383 -0.5393 -0.4378
## I(week^2)-Canis_latrans -0.2416 0.1078 -0.4565 -0.2373 -0.0349
## I(week^2)-Sciurus_niger -0.2924 0.2434 -0.8258 -0.2796 0.1510
## I(week^2)-Procyon_lotor -0.1371 0.0933 -0.3141 -0.1337 0.0451
## I(week^2)-Dasypus_novemcinctus -0.1819 0.1010 -0.3851 -0.1821 0.0079
## I(week^2)-Lynx_rufus -0.2434 0.1547 -0.5663 -0.2413 0.0503
## I(week^2)-Didelphis_virginiana -0.4084 0.2153 -0.9279 -0.3858 -0.0523
## I(week^2)-Sylvilagus_floridanus -0.1827 0.1563 -0.5026 -0.1749 0.1156
## I(week^2)-Sciurus_carolinensis -0.2856 0.1415 -0.5787 -0.2846 -0.0178
## I(week^2)-Vulpes_vulpes -0.3882 0.2388 -0.9331 -0.3737 0.0355
## I(week^2)-Sus_scrofa -0.2347 0.1769 -0.5744 -0.2329 0.0956
## Rhat ESS
## (Intercept)-Odocoileus_virginianus 1.0005 1500
## (Intercept)-Canis_latrans 1.0265 441
## (Intercept)-Sciurus_niger 1.0455 133
## (Intercept)-Procyon_lotor 1.0241 641
## (Intercept)-Dasypus_novemcinctus 1.0013 1146
## (Intercept)-Lynx_rufus 1.0664 200
## (Intercept)-Didelphis_virginiana 1.0299 721
## (Intercept)-Sylvilagus_floridanus 1.0014 723
## (Intercept)-Sciurus_carolinensis 1.0093 615
## (Intercept)-Vulpes_vulpes 1.0403 134
## (Intercept)-Sus_scrofa 1.0241 566
## shrub_cover-Odocoileus_virginianus 1.0026 1500
## shrub_cover-Canis_latrans 1.0005 608
## shrub_cover-Sciurus_niger 1.0269 320
## shrub_cover-Procyon_lotor 1.0411 281
## shrub_cover-Dasypus_novemcinctus 1.0086 695
## shrub_cover-Lynx_rufus 1.0122 323
## shrub_cover-Didelphis_virginiana 1.0209 521
## shrub_cover-Sylvilagus_floridanus 1.0171 522
## shrub_cover-Sciurus_carolinensis 1.0033 395
## shrub_cover-Vulpes_vulpes 1.0084 500
## shrub_cover-Sus_scrofa 1.0116 607
## veg_height-Odocoileus_virginianus 1.0057 1500
## veg_height-Canis_latrans 1.0050 780
## veg_height-Sciurus_niger 1.0044 215
## veg_height-Procyon_lotor 1.0086 917
## veg_height-Dasypus_novemcinctus 1.0004 1300
## veg_height-Lynx_rufus 1.0450 558
## veg_height-Didelphis_virginiana 1.0022 870
## veg_height-Sylvilagus_floridanus 1.0052 834
## veg_height-Sciurus_carolinensis 1.0147 641
## veg_height-Vulpes_vulpes 1.0159 724
## veg_height-Sus_scrofa 1.0189 783
## week-Odocoileus_virginianus 1.0017 1500
## week-Canis_latrans 1.0005 1249
## week-Sciurus_niger 1.0351 102
## week-Procyon_lotor 1.0015 1004
## week-Dasypus_novemcinctus 1.0024 1111
## week-Lynx_rufus 1.0052 774
## week-Didelphis_virginiana 1.0155 906
## week-Sylvilagus_floridanus 1.0261 670
## week-Sciurus_carolinensis 1.0074 1030
## week-Vulpes_vulpes 1.0373 424
## week-Sus_scrofa 1.0172 1086
## I(week^2)-Odocoileus_virginianus 0.9995 1500
## I(week^2)-Canis_latrans 1.0104 1148
## I(week^2)-Sciurus_niger 1.0114 150
## I(week^2)-Procyon_lotor 1.0018 1152
## I(week^2)-Dasypus_novemcinctus 1.0158 1254
## I(week^2)-Lynx_rufus 1.0039 441
## I(week^2)-Didelphis_virginiana 1.0146 479
## I(week^2)-Sylvilagus_floridanus 1.0000 749
## I(week^2)-Sciurus_carolinensis 1.0043 1099
## I(week^2)-Vulpes_vulpes 1.0389 518
## I(week^2)-Sus_scrofa 1.0097 1281
names(ms_fullQ_fullQ)
## [1] "rhat" "beta.comm.samples" "alpha.comm.samples"
## [4] "tau.sq.beta.samples" "tau.sq.alpha.samples" "beta.samples"
## [7] "alpha.samples" "z.samples" "psi.samples"
## [10] "like.samples" "sigma.sq.psi.samples" "beta.star.samples"
## [13] "re.level.names" "ESS" "X"
## [16] "X.p" "X.p.re" "X.re"
## [19] "y" "call" "n.samples"
## [22] "x.names" "sp.names" "x.p.names"
## [25] "n.post" "n.thin" "n.burn"
## [28] "n.chains" "pRE" "psiRE"
## [31] "run.time"
str(ms_fullQ_fullQ$beta.samples)
## 'mcmc' num [1:1500, 1:99] 3.96 3.37 4.55 5.85 5.87 ...
## - attr(*, "mcpar")= num [1:3] 1 1500 1
## - attr(*, "dimnames")=List of 2
## ..$ : NULL
## ..$ : chr [1:99] "(Intercept)-Odocoileus_virginianus" "(Intercept)-Canis_latrans" "(Intercept)-Sciurus_niger" "(Intercept)-Procyon_lotor" ...
mean(ms_fullQ_fullQ$beta.samples[, 5] > 0) # effect of ? on occupancy
## [1] 0.008
MCMCplot(ms_fullQ_fullQ$beta.samples, ref_ovl = TRUE, ci = c(50, 95)) # Occupancy
MCMCplot(ms_fullQ_fullQ$alpha.samples, ref_ovl = TRUE, ci = c(50, 95)) # Detection
# Set of values from the range of observed cogongrass values
cogon.pred.vals <- seq(min(data_list$occ.covs$Avg_Cogongrass_Cover),
max(data_list$occ.covs$Avg_Cogongrass_Cover),
length.out = 100)
# Scale predicted values
cogon.pred.vals.scale <- (cogon.pred.vals - mean(data_list$occ.covs$Avg_Cogongrass_Cover)) /
sd(data_list$occ.covs$Avg_Cogongrass_Cover)
# Predict occupancy across cogongrass values, given all other variables are at their mean.
pred.df <- as.matrix(data.frame(intercept = 1, Avg_Cogongrass_Cover =
cogon.pred.vals.scale, 'I(Avg_Cogongrass_Cover^2)' = 0,
Cogon_Patch_Size = 0, Veg_shannon_index = 0,
total_shrub_cover = 0, Tree_Density = 0,
Avg_Canopy_Cover = 0, avg_veg_height = 0, Auth = 0))
out.pred <- predict(ms_fullQ_fullQ, pred.df)
str(out.pred)
## List of 3
## $ psi.0.samples: num [1:1500, 1:11, 1:100] 0.974 0.958 0.992 0.999 0.998 ...
## $ z.0.samples : int [1:1500, 1:11, 1:100] 1 0 1 1 1 1 1 1 1 1 ...
## $ call : language predict.msPGOcc(object = ms_fullQ_fullQ, X.0 = pred.df)
## - attr(*, "class")= chr "predict.msPGOcc"
str(out.pred$psi.0.samples)
## num [1:1500, 1:11, 1:100] 0.974 0.958 0.992 0.999 0.998 ...
psi.0.quants <- apply(out.pred$psi.0.samples, c(3), function(x) quantile(x, prob = c(0.025, 0.5, 0.975)))
str(psi.0.quants)
## num [1:3, 1:100] 0.000154 0.111409 0.999956 0.000147 0.109098 ...
## - attr(*, "dimnames")=List of 2
## ..$ : chr [1:3] "2.5%" "50%" "97.5%"
## ..$ : NULL
psi.plot.dat <- data.frame(
psi.med = psi.0.quants[2, ],
psi.low = psi.0.quants[1, ],
psi.high = psi.0.quants[3, ],
Avg_Cogongrass_Cover = cogon.pred.vals
)
str(psi.plot.dat)
## 'data.frame': 100 obs. of 4 variables:
## $ psi.med : num 0.111 0.109 0.111 0.109 0.112 ...
## $ psi.low : num 0.000154 0.000147 0.000165 0.00019 0.00019 ...
## $ psi.high : num 1 1 1 1 1 ...
## $ Avg_Cogongrass_Cover: num -0.708 -0.675 -0.641 -0.608 -0.575 ...
ggplot(psi.plot.dat, aes(x = Avg_Cogongrass_Cover, y = psi.med)) +
geom_ribbon(aes(ymin = psi.low, ymax = psi.high), fill = "grey70") +
geom_line() +
theme_bw() +
scale_y_continuous(limits = c(0, 1)) +
labs(x = "Average Cogongrass Cover", y = "Occupancy Probability")