Skip to content

Repository files navigation

AllSeasonsPaper

  • Description: Repo with replication code and data for the paper "Preferences for attributes of forest biodiversity are variable across seasons" submitted to [Journal].
  • Function: To reproduce the analysis presented in text.
  • Author: Dr Peter King (p.king1@leeds.ac.uk)
  • Last change: 28/07/2026

Data:

  • SurveyData: The anonymised survey data at each cleaning step, from the raw export (Step0) through to the seasonal analysis frames (Step3). Only the _Anonymised.csv versions are included; the original Qualtrics exports carry response identifiers and timestamps and are withheld.
  • CEInputData: The anonymised databases used for APOLLO estimation, one per season plus the pooled and balancing-weighted files.
  • CEOutputData: Categorised output per model and hypothesis. The estimated models (_model.rds), coefficient tables (_estimates.csv) and APOLLO logs (_output.txt) are all included, so every table and figure can be reproduced without re-estimating.

Scripts:

  • SetupScripts: The cleaning scripts used to prepare data for modelling.
  • CEModelScripts: Model scripts for each hypothesis.
  • OtherScripts: Reproducing each table and figure.

Script numbers follow the order in which 00_ReplicatePaper.R sources them, and that order follows the paper: Section 3 produces the manuscript tables and figures, Section 4 the supplementary ones.

Replicate:

  • Run 00_ReplicatePaper.R to compile the paper.
  • Estimation (Sections 2 and 2B) is slow. Because CEOutputData ships with the fitted models, those sections can be skipped and Sections 3 and 4 run on their own.

Directory Structure:

├── 00_ReplicatePaper.R
├── AllSeasonsPaper.Rproj
├── CEInputData
│   ├── CE_ExampleCard.jpg
│   ├── database_AllSeasons_Step1_Anonymised.csv
│   ├── database_AllSeasons_Weighted_Step2_Anonymised.csv
│   ├── database_Autumn_Step1_Anonymised.csv
│   ├── database_Spring_Step1_Anonymised.csv
│   ├── database_Summer_Step1_Anonymised.csv
│   └── database_Winter_Step1_Anonymised.csv
├── CEModelScripts
│   ├── H1
│   │   ├── Balanced
│   │   │   └── Correlated
│   │   │       ├── 16_H1_Winter_PreferenceSpaceModel_Correlated_Balanced.R
│   │   │       ├── 17_H1_Spring_PreferenceSpaceModel_Correlated_Balanced.R
│   │   │       ├── 18_H1_Summer_PreferenceSpaceModel_Correlated_Balanced.R
│   │   │       ├── 19_H1_Autumn_PreferenceSpaceModel_Correlated_Balanced.R
│   │   │       └── 20_H1_AllSeasons_PreferenceSpaceModel_Correlated_Balanced.R
│   │   └── Correlated
│   │       ├── 05_H1_Winter_PreferenceSpaceModel_Correlated.R
│   │       ├── 06_H1_Spring_PreferenceSpaceModel_Correlated.R
│   │       ├── 07_H1_Summer_PreferenceSpaceModel_Correlated.R
│   │       ├── 08_H1_Autumn_PreferenceSpaceModel_Correlated.R
│   │       └── 09_H1_AllSeasons_PreferenceSpaceModel_Correlated.R
│   ├── H2
│   │   ├── Balanced
│   │   │   └── 21_H2_WinterFixed_ScaleModel_Balanced.R
│   │   └── Correlated
│   │       └── 10_H2_WinterFixed_ScaleModel_FullSample_Correlated_Covariates.R
│   └── H3
│       ├── Balanced
│       │   └── Correlated
│       │       ├── 22_H3_Winter_WTPSpaceModel_Balanced_Correlated.R
│       │       ├── 23_H3_Spring_WTPSpaceModel_Balanced_Correlated.R
│       │       ├── 24_H3_Summer_WTPSpaceModel_Balanced_Correlated.R
│       │       ├── 25_H3_Autumn_WTPSpaceModel_Balanced_Correlated.R
│       │       └── 26_H3_AllSeasons_WTPSpaceModel_Balanced_Correlated.R
│       └── Correlated
│           ├── 11_H3_Winter_WTPSpaceModel_Correlated.R
│           ├── 12_H3_Spring_WTPSpaceModel_Correlated.R
│           ├── 13_H3_Summer_WTPSpaceModel_Correlated.R
│           ├── 14_H3_Autumn_WTPSpaceModel_Correlated.R
│           └── 15_H3_AllSeasons_WTPSpaceModel_Correlated.R
├── CEOutputData
│   ├── H1
│   │   ├── Balanced
│   │   │   ├── H1_AllSeasons_PreferenceSpaceModel_Correlated_Balanced_estimates.csv
│   │   │   ├── H1_AllSeasons_PreferenceSpaceModel_Correlated_Balanced_model.rds
│   │   │   ├── H1_AllSeasons_PreferenceSpaceModel_Correlated_Balanced_output.txt
│   │   │   ├── H1_Autumn_PreferenceSpaceModel_Correlated_Balanced_estimates.csv
│   │   │   ├── H1_Autumn_PreferenceSpaceModel_Correlated_Balanced_model.rds
│   │   │   ├── H1_Autumn_PreferenceSpaceModel_Correlated_Balanced_output.txt
│   │   │   ├── H1_Spring_PreferenceSpaceModel_Correlated_Balanced_estimates.csv
│   │   │   ├── H1_Spring_PreferenceSpaceModel_Correlated_Balanced_model.rds
│   │   │   ├── H1_Spring_PreferenceSpaceModel_Correlated_Balanced_output.txt
│   │   │   ├── H1_Summer_PreferenceSpaceModel_Correlated_Balanced_estimates.csv
│   │   │   ├── H1_Summer_PreferenceSpaceModel_Correlated_Balanced_model.rds
│   │   │   ├── H1_Summer_PreferenceSpaceModel_Correlated_Balanced_output.txt
│   │   │   ├── H1_Winter_PreferenceSpaceModel_Correlated_Balanced_estimates.csv
│   │   │   ├── H1_Winter_PreferenceSpaceModel_Correlated_Balanced_model.rds
│   │   │   └── H1_Winter_PreferenceSpaceModel_Correlated_Balanced_output.txt
│   │   └── Correlated
│   │       ├── H1_AllSeasons_PreferenceSpaceModel_Correlated_estimates.csv
│   │       ├── H1_AllSeasons_PreferenceSpaceModel_Correlated_model.rds
│   │       ├── H1_AllSeasons_PreferenceSpaceModel_Correlated_output.txt
│   │       ├── H1_Autumn_PreferenceSpaceModel_Correlated_estimates.csv
│   │       ├── H1_Autumn_PreferenceSpaceModel_Correlated_model.rds
│   │       ├── H1_Autumn_PreferenceSpaceModel_Correlated_output.txt
│   │       ├── H1_Spring_PreferenceSpaceModel_Correlated_estimates.csv
│   │       ├── H1_Spring_PreferenceSpaceModel_Correlated_model.rds
│   │       ├── H1_Spring_PreferenceSpaceModel_Correlated_output.txt
│   │       ├── H1_Summer_PreferenceSpaceModel_Correlated_estimates.csv
│   │       ├── H1_Summer_PreferenceSpaceModel_Correlated_model.rds
│   │       ├── H1_Summer_PreferenceSpaceModel_Correlated_output.txt
│   │       ├── H1_Winter_PreferenceSpaceModel_Correlated_estimates.csv
│   │       ├── H1_Winter_PreferenceSpaceModel_Correlated_model.rds
│   │       └── H1_Winter_PreferenceSpaceModel_Correlated_output.txt
│   ├── H2
│   │   ├── Balanced
│   │   │   ├── H2_WinterFixed_ScaleModel_Balanced_Correlated_estimates.csv
│   │   │   ├── H2_WinterFixed_ScaleModel_Balanced_Correlated_model.rds
│   │   │   └── H2_WinterFixed_ScaleModel_Balanced_Correlated_output.txt
│   │   └── Correlated
│   │       ├── H2_WinterFixed_ScaleModel_FullSample_Correlated_Covariates_estimates.csv
│   │       ├── H2_WinterFixed_ScaleModel_FullSample_Correlated_Covariates_model.rds
│   │       └── H2_WinterFixed_ScaleModel_FullSample_Correlated_Covariates_output.txt
│   └── H3
│       ├── AllSeasons_Correlated.csv
│       ├── Balanced
│       │   ├── H3_AllSeasons_WTPSpaceModel_Balanced_Correlated_estimates.csv
│       │   ├── H3_AllSeasons_WTPSpaceModel_Balanced_Correlated_model.rds
│       │   ├── H3_AllSeasons_WTPSpaceModel_Balanced_Correlated_output.txt
│       │   ├── H3_Autumn_WTPSpaceModel_Balanced_Correlated_estimates.csv
│       │   ├── H3_Autumn_WTPSpaceModel_Balanced_Correlated_model.rds
│       │   ├── H3_Autumn_WTPSpaceModel_Balanced_Correlated_output.txt
│       │   ├── H3_Spring_WTPSpaceModel_Balanced_Correlated_estimates.csv
│       │   ├── H3_Spring_WTPSpaceModel_Balanced_Correlated_model.rds
│       │   ├── H3_Spring_WTPSpaceModel_Balanced_Correlated_output.txt
│       │   ├── H3_Summer_WTPSpaceModel_Balanced_Correlated_estimates.csv
│       │   ├── H3_Summer_WTPSpaceModel_Balanced_Correlated_model.rds
│       │   ├── H3_Summer_WTPSpaceModel_Balanced_Correlated_output.txt
│       │   ├── H3_Winter_WTPSpaceModel_Balanced_Correlated_estimates.csv
│       │   ├── H3_Winter_WTPSpaceModel_Balanced_Correlated_model.rds
│       │   └── H3_Winter_WTPSpaceModel_Balanced_Correlated_output.txt
│       ├── Correlated
│       │   ├── H3_AllSeasons_WTPSpaceModel_Correlated_estimates.csv
│       │   ├── H3_AllSeasons_WTPSpaceModel_Correlated_model.rds
│       │   ├── H3_AllSeasons_WTPSpaceModel_Correlated_output.txt
│       │   ├── H3_Autumn_WTPSpaceModel_Correlated_estimates.csv
│       │   ├── H3_Autumn_WTPSpaceModel_Correlated_model.rds
│       │   ├── H3_Autumn_WTPSpaceModel_Correlated_output.txt
│       │   ├── H3_Spring_WTPSpaceModel_Correlated_estimates.csv
│       │   ├── H3_Spring_WTPSpaceModel_Correlated_model.rds
│       │   ├── H3_Spring_WTPSpaceModel_Correlated_output.txt
│       │   ├── H3_Summer_WTPSpaceModel_Correlated_estimates.csv
│       │   ├── H3_Summer_WTPSpaceModel_Correlated_model.rds
│       │   ├── H3_Summer_WTPSpaceModel_Correlated_output.txt
│       │   ├── H3_Winter_WTPSpaceModel_Correlated_estimates.csv
│       │   ├── H3_Winter_WTPSpaceModel_Correlated_model.rds
│       │   └── H3_Winter_WTPSpaceModel_Correlated_output.txt
│       └── SimulatedMeans_Correlated.csv
├── Figure1_ExampleCE.tif
├── LICENSE
├── OtherOutput
│   ├── Figures
│   │   ├── H0_FigureA1_VisitFrequencyBySeasons.png
│   │   ├── H2_FigureA2_ChoiceVarianceBySeason.png
│   │   ├── H2_FigureA3_VisitVarianceBySeason.png
│   │   ├── H2_FigureA3_VisitVarianceBySeason_Extra.png
│   │   └── H3_Figure2_DistributionSimulatedWTPBySeason.png
│   └── Tables
│       ├── H3_WaldTests_Full_WithCorrections.txt
│       ├── Table3_PoeTestsWTP_Correlated.txt
│       ├── TableA4_H1_LRtests_Balanced.txt
│       ├── TableB1_H2_Waldtests.txt
│       └── TableC1_H3_WTPsummary_Correlated.txt
├── OtherScripts
│   ├── Figures
│   │   ├── 30_H3_Figure2_BoxWhiskersDistributionsWTPBySeason.R
│   │   ├── 33_H0_FigureA1_VisitFrequencyBySeason.R
│   │   ├── 34_H2_FigureA2_ScaleVariance.R
│   │   └── 35_H2_FigureA3_ScaleVarianceVisitFrequency.R
│   └── Tables
│       ├── 27_H1_Table1_LRtests.R
│       ├── 28_H2_Table2_Waldtests.R
│       ├── 29_H3_SimulateMeans.R
│       ├── 31_H4_Table3_PoeTestsWTP.R
│       ├── 32_H0_TableA1_GTestsCombined.R
│       ├── 36_H1_TableA2_ModelOutputsCorrelated.R
│       ├── 37_H1_TableA3_ModelOutputsCorrelated_Balanced.R
│       ├── 38_H1_TableA4_LRtests_Balanced.R
│       ├── 39_H2_TableB1_Waldtests_Balanced.R
│       ├── 40_H3_TableC1_WTPSummary.R
│       ├── 41_H3_TableC2_WaldTestsWTP.R
│       ├── 42_H3_TableC3_WTPSpaceModelOutputs.R
│       └── 43_H3_TableC4_OrdinalTests.R
├── README.md
├── RELATE Seasonal Questionnaire_word print out.docx
├── SetupScripts
│   ├── 01_CleanSurveyData.R
│   ├── 02_SurveyDataAddSpatial.R
│   ├── 03_SurveyDataAddCE.R
│   └── 04_AddBalancingWeights.R
└── SurveyData
    ├── AllSeasons_dataframe_Step3_Anonymised.csv
    ├── AllSeasons_SurveyData_CleanedNoSpatial_Step1_Anonymised.csv
    ├── AllSeasons_SurveyData_NoCE_Step2_Anonymised.csv
    ├── AllSeasons_SurveyData_NotCleaned_Step0_Anonymised.csv
    ├── Autumn_dataframe_Step3_Anonymised.csv
    ├── Spring_dataframe_Step3_Anonymised.csv
    ├── Summer_dataframe_Step3_Anonymised.csv
    └── Winter_dataframe_Step3_Anonymised.csv

Session information:

Note: the model outputs shipped in CEOutputData were estimated with apollo 0.3.6 on R 4.5.1 (Linux), so the estimation environment differs from the Windows session recorded below.

# ─ Session info ─────────────────────────────────────────────────────
# setting  value
# version  R version 4.5.0 (2025-04-11 ucrt)
# os       Windows 11 x64 (build 22631)
# system   x86_64, mingw32
# ui       RStudio
# language (EN)
# collate  English_United Kingdom.utf8
# ctype    English_United Kingdom.utf8
# tz       Europe/London
# date     2025-10-16
# rstudio  2023.06.2+561 Mountain Hydrangea (desktop)
# pandoc   NA
# quarto   ERROR: Unknown command
# "TMPDIR=C:/Users/[]/AppData/Local/Temp/Rtmpqi98xo/file68846200121c".
# Did you mean command "create-project"? @ C:\\PROGRA~1\\RStudio\\RESOUR~1\\app\\bin\\quarto\\bin\\quarto.exe
#
# ─ Packages ─────────────────────────────────────────────────────────
# ! package        * version    date (UTC) lib source
# abind            1.4-8      2024-09-12 [1] CRAN (R 4.5.0)
# AMR            * 2.1.1      2023-10-21 [1] CRAN (R 4.5.0)
# aod            * 1.3.3      2023-12-13 [1] CRAN (R 4.5.0)
# apollo         * 0.3.5      2025-03-12 [1] CRAN (R 4.5.0)
# backports        1.5.0      2024-05-23 [1] CRAN (R 4.5.0)
# bgw              0.1.3      2024-03-29 [1] CRAN (R 4.5.0)
# broom            1.0.8      2025-03-28 [1] CRAN (R 4.5.0)
# car              3.1-3      2024-09-27 [1] CRAN (R 4.5.0)
# carData          3.0-5      2022-01-06 [1] CRAN (R 4.5.0)
# cellranger       1.1.0      2016-07-27 [1] CRAN (R 4.5.0)
# cli              3.6.5      2025-04-23 [1] CRAN (R 4.5.0)
# cobalt         * 4.6.0      2025-04-15 [1] CRAN (R 4.5.0)
# coda             0.19-4.1   2024-01-31 [1] CRAN (R 4.5.0)
# crayon           1.5.3      2024-06-20 [1] CRAN (R 4.5.0)
# data.table     * 1.17.2     2025-05-12 [1] CRAN (R 4.5.0)
# dichromat        2.0-0.1    2022-05-02 [1] CRAN (R 4.5.0)
# digest           0.6.37     2024-08-19 [1] CRAN (R 4.5.0)
# distributional   0.5.0      2024-09-17 [1] CRAN (R 4.5.0)
# dplyr          * 1.1.4      2023-11-17 [1] CRAN (R 4.5.0)
# farver           2.1.2      2024-05-13 [1] CRAN (R 4.5.0)
# forcats        * 1.0.0      2023-01-29 [1] CRAN (R 4.5.0)
# Formula          1.2-5      2023-02-24 [1] CRAN (R 4.5.0)
# generics         0.1.4      2025-05-09 [1] CRAN (R 4.5.0)
# geosphere      * 1.5-20     2024-10-04 [1] CRAN (R 4.5.0)
# ggdist         * 3.3.3      2025-04-23 [1] CRAN (R 4.5.0)
# ggplot2        * 3.5.2      2025-04-09 [1] CRAN (R 4.5.0)
# ggridges       * 0.5.6      2024-01-23 [1] CRAN (R 4.5.0)
# glue             1.8.0      2024-09-30 [1] CRAN (R 4.5.0)
# gtable           0.3.6      2024-10-25 [1] CRAN (R 4.5.0)
# here           * 1.0.1      2020-12-13 [1] CRAN (R 4.5.0)
# hms              1.1.3      2023-03-21 [1] CRAN (R 4.5.0)
# httr             1.4.7      2023-08-15 [1] CRAN (R 4.5.0)
# janitor        * 2.2.1      2024-12-22 [1] CRAN (R 4.5.0)
# lattice          0.22-7     2025-04-02 [1] CRAN (R 4.5.0)
# lifecycle        1.0.4      2023-11-07 [1] CRAN (R 4.5.0)
# lmtest         * 0.9-40     2022-03-21 [1] CRAN (R 4.5.0)
# lubridate      * 1.9.4      2024-12-08 [1] CRAN (R 4.5.0)
# magrittr       * 2.0.3      2022-03-30 [1] CRAN (R 4.5.0)
# MASS             7.3-65     2025-02-28 [1] CRAN (R 4.5.0)
# MatchIt        * 4.7.1      2025-03-10 [1] CRAN (R 4.5.0)
# Matrix           1.7-3      2025-03-11 [1] CRAN (R 4.5.0)
# MatrixModels     0.5-4      2025-03-26 [1] CRAN (R 4.5.0)
# matrixStats    * 1.5.0      2025-01-07 [1] CRAN (R 4.5.0)
# maxLik           1.5-2.1    2024-03-24 [1] CRAN (R 4.5.0)
# mcmc             0.9-8      2023-11-16 [1] CRAN (R 4.5.0)
# MCMCpack         1.7-1      2024-08-27 [1] CRAN (R 4.5.0)
# mded           * 0.1-2      2015-04-27 [1] CRAN (R 4.5.0)
# miscTools        0.6-28     2023-05-03 [1] CRAN (R 4.5.0)
# mnormt           2.1.1      2022-09-26 [1] CRAN (R 4.5.0)
# mvtnorm          1.3-3      2025-01-10 [1] CRAN (R 4.5.0)
# nlme             3.1-168    2025-03-31 [1] CRAN (R 4.5.0)
# numDeriv         2016.8-1.1 2019-06-06 [1] CRAN (R 4.5.0)
# pillar           1.10.2     2025-04-05 [1] CRAN (R 4.5.0)
# pkgconfig        2.0.3      2019-09-22 [1] CRAN (R 4.5.0)
# plyr             1.8.9      2023-10-02 [1] CRAN (R 4.5.0)
# PostcodesioR   * 0.3.1      2021-12-01 [1] CRAN (R 4.5.0)
# psych          * 2.5.3      2025-03-21 [1] CRAN (R 4.5.0)
# purrr          * 1.0.4      2025-02-05 [1] CRAN (R 4.5.0)
# quantreg         6.1        2025-03-10 [1] CRAN (R 4.5.0)
# R6               2.6.1      2025-02-15 [1] CRAN (R 4.5.0)
# randtoolbox      2.0.5      2024-10-18 [1] CRAN (R 4.5.0)
# RColorBrewer   * 1.1-3      2022-04-03 [1] CRAN (R 4.5.0)
# Rcpp           * 1.0.14     2025-01-12 [1] CRAN (R 4.5.0)
# D RcppParallel   * 5.1.10     2025-01-24 [1] CRAN (R 4.5.0)
# readr          * 2.1.5      2024-01-10 [1] CRAN (R 4.5.0)
# readxl         * 1.4.5      2025-03-07 [1] CRAN (R 4.5.0)
# reshape2       * 1.4.4      2020-04-09 [1] CRAN (R 4.5.0)
# Rfast          * 2.1.5.1    2025-03-14 [1] CRAN (R 4.5.0)
# rlang            1.1.6      2025-04-11 [1] CRAN (R 4.5.0)
# rngWELL          0.10-10    2024-10-17 [1] CRAN (R 4.5.0)
# rprojroot        2.0.4      2023-11-05 [1] CRAN (R 4.5.0)
# RSGHB            1.2.2      2019-07-03 [1] CRAN (R 4.5.0)
# Rsolnp           1.16       2015-12-28 [1] CRAN (R 4.5.0)
# rstatix        * 0.7.2      2023-02-01 [1] CRAN (R 4.5.0)
# rstudioapi       0.17.1     2024-10-22 [1] CRAN (R 4.5.0)
# sandwich         3.1-1      2024-09-15 [1] CRAN (R 4.5.0)
# scales         * 1.4.0      2025-04-24 [1] CRAN (R 4.5.0)
# sessioninfo      1.2.3      2025-02-05 [1] CRAN (R 4.5.0)
# snakecase        0.11.1     2023-08-27 [1] CRAN (R 4.5.0)
# sp               2.2-0      2025-02-01 [1] CRAN (R 4.5.0)
# SparseM          1.84-2     2024-07-17 [1] CRAN (R 4.5.0)
# stringi          1.8.7      2025-03-27 [1] CRAN (R 4.5.0)
# stringr        * 1.5.1      2023-11-14 [1] CRAN (R 4.5.0)
# survival         3.8-3      2024-12-17 [1] CRAN (R 4.5.0)
# tibble         * 3.2.1      2023-03-20 [1] CRAN (R 4.5.0)
# tidyr          * 1.3.1      2024-01-24 [1] CRAN (R 4.5.0)
# tidyselect       1.2.1      2024-03-11 [1] CRAN (R 4.5.0)
# tidyverse      * 2.0.0      2023-02-22 [1] CRAN (R 4.5.0)
# timechange       0.3.0      2024-01-18 [1] CRAN (R 4.5.0)
# truncnorm        1.0-9      2023-03-20 [1] CRAN (R 4.5.0)
# tzdb             0.5.0      2025-03-15 [1] CRAN (R 4.5.0)
# udunits2       * 0.13.2.1   2022-03-11 [1] CRAN (R 4.5.0)
# vctrs            0.6.5      2023-12-01 [1] CRAN (R 4.5.0)
# WeightIt       * 1.4.0      2025-02-24 [1] CRAN (R 4.5.0)
# withr            3.0.2      2024-10-28 [1] CRAN (R 4.5.0)
# zigg           * 0.0.2      2025-02-07 [1] CRAN (R 4.5.0)
# zoo            * 1.8-14     2025-04-10 [1] CRAN (R 4.5.0)

Any Questions: p.king1@leeds.ac.uk

About

Repo with replication code and data for the paper "Seasonal stability of preferences for attributes of forest biodiversity" submitted to ERE.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages