Last updated on

October 21, 2024

About the Material

This site serves as a compendium of teaching and coding material that I developed along the 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

Package Overview

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

pkgList <- c("base",
             "pak",
             "quarto",
             "rmarkdown",
             "knitr",
             "devtools",
             "haven",
             "renv",
             "stringr",
             "dplyr",
             "moments",
             "psych",
             "lme4",
             "merTools",
             "mice",
             "lavaan",
             "kableExtra",
             "flextable",
             "ggplot2")
  1. base (v4.4.1, R-base?)
  2. pak (v0.8.0, R-pak?)
  3. quarto (v1.4.4, R-quarto?)
  4. rmarkdown (v2.27, R-rmarkdown?)
  5. knitr (v1.47, R-knitr?)
  6. devtools (v2.4.5, R-devtools?)
  7. haven (v2.5.4, R-haven?)
  8. renv (v1.0.9, R-renv?)
  9. stringr (v1.5.1, R-stringr?)
  10. dplyr (v1.1.4, R-dplyr?)
  11. moments (v0.14.1, R-moments?)
  12. psych (v2.4.6.26, R-psych?)
  13. lme4 (v1.1.35.4, R-lme4?)
  14. merTools (v0.6.2, Knowles et al., 2023)
  15. mice (v3.16.0, R-mice?)
  16. lavaan (v0.6.18, R-lavaan?)
  17. kableExtra (v1.4.0, R-kableExtra?)
  18. flextable (v0.9.6, R-flextable?)
  19. ggplot2 (v3.5.1, R-ggplot2?)

Installation

Before installing the packages, install the pak package (R-pak?). The pak package is desinged to overcome some limitations of the install.packages() function and makes package management in R more reliable.

install.packages("pak", dependencies = TRUE)

To install the packages, run one of the following code snippets.

How I generated the code
installedPkgs <- as.data.frame(installed.packages()[, c("Package", "Version")]) |>
                    subset(subset = Package %in% pkgList[-1]) # delete base

paste0("myPks <- c(",
    paste0("'", with(installedPkgs, paste0(Package, "@", Version)), "'",
           collapse = ", "),
    ")") |>
      stringr::str_wrap(width = 80) |>
      cat()
myPks <- c('devtools@2.4.5', 'dplyr@1.1.4', 'flextable@0.9.6', 'ggplot2@3.5.1',
'haven@2.5.4', 'kableExtra@1.4.0', 'knitr@1.47', 'lavaan@0.6-18',
'lme4@1.1-35.4', 'merTools@0.6.2', 'mice@3.16.0', 'moments@0.14.1',
'pak@0.8.0', 'psych@2.4.6.26', 'quarto@1.4.4', 'renv@1.0.9', 'rmarkdown@2.27',
'stringr@1.5.1')
pak::pkg_install(pkg = myPks, upgrade = FALSE)
pak::pkg_install(pkg = pkgList, upgrade = TRUE)

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

Knowles, J. E., Frederick, C., & Whitworth, A. (2023). merTools: Tools for Analyzing Mixed Effect Regression Models. https://github.com/jknowles/merTools