Last updated on

October 8, 2024

About the Material

This site serves as a compendium of teaching and coding material that I developed along th last couple of years. The material is based on text books (references will be given), websites (e.g., https://stats.stackexchange.com/), AI tools (e.g., ChatGPT, Blackbox AI). Many of the materials are also available as a Revealjs presentation that I usually use in teaching.

Used Software

The majority of the provided code is from the statistical software (R Core Team, 2024). Below, I list the packages I use most frequently, along with their respective versions.

pkgList <- c("base",
             "devtools",
             "haven",
             "renv",
             "stringr",
             "dplyr",
             "moments",
             "psych",
             "lme4",
             "merTools",
             "mice",
             "lavaan",
             "knitr",
             "kableExtra",
             "flextable",
             "ggplot2")
  1. base (v4.4.1, R Core Team, 2024)
  2. devtools (v2.4.5, Wickham et al., 2022)
  3. haven (v2.5.4, Wickham, Miller, et al., 2023)
  4. renv (v1.0.9, Ushey & Wickham, 2024)
  5. stringr (v1.5.1, Wickham, 2023)
  6. dplyr (v1.1.4, Wickham, François, et al., 2023)
  7. moments (v0.14.1, Komsta & Novomestky, 2022)
  8. psych (v2.4.6.26, Revelle, 2024)
  9. lme4 (v1.1.35.4, Bates et al., 2024)
  10. merTools (v0.6.2, Knowles & Frederick, 2024)
  11. mice (v3.16.0, van Buuren & Groothuis-Oudshoorn, 2023)
  12. lavaan (v0.6.18, Rosseel et al., 2023)
  13. knitr (v1.47, Xie, 2023)
  14. kableExtra (v1.4.0, Zhu, 2024)
  15. flextable (v0.9.6, Gohel & Skintzos, 2024)
  16. ggplot2 (v3.5.1, Wickham, Chang, et al., 2023)
  1. Install the remotes package (Csárdi et al., 2024).
install.packages("remotes", dependencies = TRUE)
  1. Then run the following code.
How I generated the code
installedPkgs <- as.data.frame(installed.packages()[, c("Package", "Version")]) |>
                    subset(subset = Package %in% pkgList[-1]) # delete base

apply(installedPkgs, 1, function(pkg) {
  paste0("remotes::install_version('",
         pkg[1], "', version = '",
         pkg[2], "', repos = getOption(\"repos\"))")
         }) |>
  cat(sep = "\n\n")
remotes::install_version('devtools', version = '2.4.5', repos = getOption("repos"))

remotes::install_version('dplyr', version = '1.1.4', repos = getOption("repos"))

remotes::install_version('flextable', version = '0.9.6', repos = getOption("repos"))

remotes::install_version('ggplot2', version = '3.5.1', repos = getOption("repos"))

remotes::install_version('haven', version = '2.5.4', repos = getOption("repos"))

remotes::install_version('kableExtra', version = '1.4.0', repos = getOption("repos"))

remotes::install_version('knitr', version = '1.47', repos = getOption("repos"))

remotes::install_version('lavaan', version = '0.6-18', repos = getOption("repos"))

remotes::install_version('lme4', version = '1.1-35.4', repos = getOption("repos"))

remotes::install_version('merTools', version = '0.6.2', repos = getOption("repos"))

remotes::install_version('mice', version = '3.16.0', repos = getOption("repos"))

remotes::install_version('moments', version = '0.14.1', repos = getOption("repos"))

remotes::install_version('psych', version = '2.4.6.26', repos = getOption("repos"))

remotes::install_version('renv', version = '1.0.9', repos = getOption("repos"))

remotes::install_version('stringr', version = '1.5.1', repos = getOption("repos"))

Disclaimer

All material is licensed under the MIT License (MIT) and comes with ABSOLUTELY NO WARRANTY.

Important

The MIT License

Copyright (c) 2023

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Bugs & Errors

Found errors or any bugs? Please send me an email or report them directly to github.com. At every page, below the table of contents, there is link to the repository of the website. If you think your issue may important for others, please use this option.

References

Bates, D., Maechler, M., Bolker, B., & Walker, S. (2024). lme4: Linear mixed-effects models using eigen and S4. https://github.com/lme4/lme4/
Csárdi, G., Hester, J., Wickham, H., Chang, W., Morgan, M., & Tenenbaum, D. (2024). Remotes: R package installation from remote repositories, including GitHub. https://remotes.r-lib.org
Gohel, D., & Skintzos, P. (2024). Flextable: Functions for tabular reporting. https://ardata-fr.github.io/flextable-book/
Knowles, J. E., & Frederick, C. (2024). merTools: Tools for analyzing mixed effect regression models. https://CRAN.R-project.org/package=merTools
Komsta, L., & Novomestky, F. (2022). Moments: Moments, cumulants, skewness, kurtosis and related tests. https://www.r-project.org
R Core Team. (2024). R: A language and environment for statistical computing. R Foundation for Statistical Computing. https://www.R-project.org/
Revelle, W. (2024). Psych: Procedures for psychological, psychometric, and personality research. https://personality-project.org/r/psych/ https://personality-project.org/r/psych-manual.pdf
Rosseel, Y., Jorgensen, T. D., & De Wilde, L. (2023). Lavaan: Latent variable analysis. https://lavaan.ugent.be
Ushey, K., & Wickham, H. (2024). Renv: Project environments. https://rstudio.github.io/renv/
van Buuren, S., & Groothuis-Oudshoorn, K. (2023). Mice: Multivariate imputation by chained equations. https://github.com/amices/mice
Wickham, H. (2023). Stringr: Simple, consistent wrappers for common string operations. https://stringr.tidyverse.org
Wickham, H., Chang, W., Henry, L., Pedersen, T. L., Takahashi, K., Wilke, C., Woo, K., Yutani, H., & Dunnington, D. (2023). ggplot2: Create elegant data visualisations using the grammar of graphics. https://ggplot2.tidyverse.org
Wickham, H., François, R., Henry, L., Müller, K., & Vaughan, D. (2023). Dplyr: A grammar of data manipulation. https://dplyr.tidyverse.org
Wickham, H., Hester, J., Chang, W., & Bryan, J. (2022). Devtools: Tools to make developing r packages easier. https://devtools.r-lib.org/
Wickham, H., Miller, E., & Smith, D. (2023). Haven: Import and export SPSS, stata and SAS files. https://haven.tidyverse.org
Xie, Y. (2023). Knitr: A general-purpose package for dynamic report generation in r. https://yihui.org/knitr/
Zhu, H. (2024). kableExtra: Construct complex table with kable and pipe syntax. http://haozhu233.github.io/kableExtra/