Main content

Home

Menu

Loading wiki pages...

View
Wiki Version:
### **Repository description:** Files associated with the paper #### O’Dea, R. E., Noble, D. W. A., & Nakagawa, S. (2021). Unifying individual differences in personality, predictability and plasticity: A practical guide. *Methods in Ecology and Evolution*. [https://doi.org/10.1111/2041-210X.13755](https://doi.org/10.1111/2041-210X.13755) Corresponding author: Rose E. O'Dea (rose.eleanor.o.dea@gmail.com) ### **[Files](https://osf.io/v3qax/files/) descriptions:** #### **Code**: - **[brms_conversion_demonstration.Rmd](https://osf.io/7kzhe/):** R markdown code for showing how equivalent models from the worked example can be run with the `brms` package. When using `brms` the dispersion model is on the $\ln({\sigma_{e_{ij}}})$ scale (rather than the $\ln({\sigma^2_{e_{ij}}})$ scale used throughout our manuscript), so this document shows how to convert dispersion scale parameters to calculate repeatability and the coefficient of individual variation. The knitted html can be viewed at [https://daniel1noble.github.io/individual_differences/](https://daniel1noble.github.io/individual_differences/). - **[Conceptual Figures.Rmd](https://osf.io/vfasz/):** R markdown code for creating [Figure 1](https://osf.io/qvpbn/), [Figure 2](https://osf.io/2y8hg/), and [Figure 3](https://osf.io/6v9hw/) from the main text. - **[stancode_bivar_dhglm.stan](https://osf.io/wnbfv/):** stan code for a bivariate double hierarchical generalized linear model - **[stancode_bivar_shglm.stan](https://osf.io/mwsr5/):** stan code for a bivariate single hierarchical generalized linear model - **[stancode_personality_dhglm.stan](https://osf.io/34rnx/):** stan code for a univariate double hierarchical generalized linear model with a fixed slope - **[stancode_personality_plasticity_dhglm.stan](https://osf.io/5cehp/):** stan code for a univariate double hierarchical generalized linear model with a random slope - **[stancode_personality_plasticity_shglm](https://osf.io/z25a4/):** stan code for a univariate single hierarchical generalized linear model with a random slope - **[stancode_personality_shglm.stan](https://osf.io/8mvs7/):** stan code for a univariate double hierarchical generalized linear model with a fixed slope - **[Step 1 - Prepare Data.R](https://osf.io/e67dg/):** R code for importing zebrafish behavioural data, and exporting processed data lists to feed into the six types of stan models. - **[Step 2 - Run Models.R](https://osf.io/qpg8f/):** R code for running six types of stan models, and saving the stan model objects. This is the most computationally taxing file: it took over 7 hours to run on an [external computer cluster](https://research.unsw.edu.au/katana) (running times for the saved models can be accessed using the ['get_elapsed_time'](https://cran.r-project.org/web/packages/rstan/vignettes/stanfit-objects.html#warmup-and-sampling-times) function in rstan). The resulting [stanfit objects](https://cran.r-project.org/web/packages/rstan/vignettes/stanfit-objects.html) are saved in the 'Models' folder. - **[Step 3 - Process.R](https://osf.io/gx9sr/):** R code for processing the stan model objects, and exporting a sample of posterior distributions from each model. - **[Step 4 - Generate Results.Rmd](https://osf.io/zupjf/):** R markdown code for generating [results tables](https://osf.io/2qczp/), [Figure S2](https://osf.io/ypbmk/), [Figure S3](https://osf.io/j5sqk/), [Figure S4](https://osf.io/p2dc4/), and all the diagnostic figures (a sample of which are shown in the supplement as Figures SD01-SD14). #### **Data**: - **[data_predictability_worked_example.csv](https://osf.io/yx93p/):** processed zebrafish behavioural data used in the worked example. Pre-processed data is available from a [separate repository](https://osf.io/umqb8/files/) for O'Dea's PhD thesis (in the 'Chapter 2' folder). - **[metadata_predictability_worked_example.xlsx](https://osf.io/krvq7/):** metadata file, with column descriptions matching the columns in '[data_predictability_worked_example.csv](https://osf.io/yx93p/)'. - **[standata_bivar.Rdata](https://osf.io/r39pq/):** Rdata file containing multiple data lists, which are fed into the bivariate stan models in '[Step 3 - Process.R](https://osf.io/gx9sr/)'. - **[standata_personality.Rdata](https://osf.io/u85vm/):** Rdata file containing multiple data lists, which are fed into the univariate stan models with fixed slopes in '[Step 3 - Process.R](https://osf.io/gx9sr/)'. - **[standata_personality_plasticity.Rdata](https://osf.io/br5d6/):** Rdata file containing multiple data lists, which are fed into the univariate stan models with random slopes in '[Step 3 - Process.R](https://osf.io/gx9sr/)'. #### **Figures**: - PDF files of figures included in the main text. - **Diagnostics**: PDF files of figures included in the supplementary information, as well as traceplots exported from all models. #### **Models**: - **[brms_models/brms_bivar_dhglm_activity_aggression](https://osf.io/89dt5/):** brms model object exported from [brms_conversion_demonstration.Rmd](https://osf.io/7kzhe/) for activity and aggression (bivariate model), with individual differences in personality, plasticity, and predictability - **[brms_models/brms_bivar_shglm_activity_aggression](https://osf.io/9u3mq/):** brms model object exported from [brms_conversion_demonstration.Rmd](https://osf.io/7kzhe/) for activity and aggression (bivariate model), with individual differences in personality and plasticity - **[brms_models/brms_personality_dhglm_aggression](https://osf.io/sfjdm/):** brms model object exported from [brms_conversion_demonstration.Rmd](https://osf.io/7kzhe/) for aggression, with individual differences in personality and predictability - **[brms_models/brms_personality_plasticity_dhglm_aggression](https://osf.io/5x4w9/):** brms model object exported from [brms_conversion_demonstration.Rmd](https://osf.io/7kzhe/) for aggression, with individual differences in personality, plasticity, and predictability - **[brms_models/brms_personality_plasticity_shglm_aggression](https://osf.io/7sp3b/):** brms model object exported from [brms_conversion_demonstration.Rmd](https://osf.io/7kzhe/) for aggression, with individual differences in personality and plasticity - **[brms_models/brms_personality_shglm_aggression](https://osf.io/3j6vs/):** brms model object exported from [brms_conversion_demonstration.Rmd](https://osf.io/7kzhe/) for aggression, with individual differences in personality - **[stanmodels_bivar_dhglm.Rdata](https://osf.io/dwhqm/):** Rdata file containing [stanfit objects](https://cran.r-project.org/web/packages/rstan/vignettes/stanfit-objects.html) for bivariate double hierarchical generalized linear models, exported from '[Step 2 - Run Models.R](https://osf.io/qpg8f/)'. - **[stanmodels_bivar_shglm.Rdata](https://osf.io/7qrws/):** Rdata file containing [stanfit objects](https://cran.r-project.org/web/packages/rstan/vignettes/stanfit-objects.html) for bivariate single hierarchical generalized linear models, exported from '[Step 2 - Run Models.R](https://osf.io/qpg8f/)'. - **[stanmodels_personality.Rdata](https://osf.io/h69sb/):** Rdata file containing [stanfit objects](https://cran.r-project.org/web/packages/rstan/vignettes/stanfit-objects.html) for both univariate single hierarchical and double hierarchical generalized linear models, with fixed slopes, exported from '[Step 2 - Run Models.R](https://osf.io/qpg8f/)'. - **[stanmodels_personality_plasticity.Rdata](https://osf.io/hpynd/):** Rdata file containing [stanfit objects](https://cran.r-project.org/web/packages/rstan/vignettes/stanfit-objects.html) for both univariate single hierarchical and double hierarchical generalized linear models, with random slopes, exported from '[Step 2 - Run Models.R](https://osf.io/qpg8f/)'. #### **Preprint**: - **[Main_Text_ODeaNobleNakagawa2020.pdf](https://osf.io/ky8cp/):** Preprint of the main text manuscript - **[Supplementary_Information_ODeaNobleNakagawa2020.pdf](https://osf.io/mws98/):** PDF file of supplementary information with with equations and descriptions of reversing non-linear transformations, conversions to the coefficient of predictabiity, and the worked example methods and results. #### **Results**: - **[stanmodels_processed.Rdata](https://osf.io/jdqt5/):** Rdata file exported from '[Step 3 - Process.R](https://osf.io/gx9sr/)' containing two dataframes: (1) 'stanmods' contains a sample of 1000 draws from the posterior distributions of each model, for both parameters exported directly from the models, and calculated parameters. BLUPs are spread across different columns. (2) 'stanmods_stats' contains posterior means and credible intervals for the parameters contained in 'stanmods', as well as individual intercepts and slopes calculated from population parameters and BLUPs. BLUPs are spread across different rows, therefore, for each model, population parameters are replicated across multiple rows. - **[stanmods_chains.Rdata](https://osf.io/6m75b/):** Rdata file containing a large dataframe with the x and y coordinates for [traceplots](https://mc-stan.org/rstan/reference/stanfit-method-traceplot.html) for the three chains from every model, for the main population parameters. - **[stanmods_Rhats.Rdata](https://osf.io/2f9t4/):** Rdata file containing a dataframe with the [Rhat statistic](https://mc-stan.org/rstan/reference/Rhat.html) for the main population parameters from every model as well as the [effective sample size](https://mc-stan.org/docs/2_18/reference-manual/effective-sample-size-section.html). - **[Worked Example Results Tables.xlsx](https://osf.io/2qczp/):** Excel file with three sheets for the three supplementary tables: Table S01, Table S02, and Table S03.
OSF does not support the use of Internet Explorer. For optimal performance, please switch to another browser.
Accept
This website relies on cookies to help provide a better user experience. By clicking Accept or continuing to use the site, you agree. For more information, see our Privacy Policy and information on cookie use.
Accept
×

Start managing your projects on the OSF today.

Free and easy to use, the Open Science Framework supports the entire research lifecycle: planning, execution, reporting, archiving, and discovery.