Last updated 2023-09-03.
This Github repo contains all lesson files for Practical Applications
in R for Psychologists. The goal is to impart students with the basic
tools to process data, describe data (w/ summary statistics and plots),
and the foundations of building, evaluating and comparing statistical
models in R
, focusing on linear regression modeling (using both
frequentist and Bayesian approaches).
These topics were taught in the graduate-level course Advanced Research Methods for Psychologists (Psych Dep., Ben-Gurion University of the Negev), laying the foundation for the following topic-focused courses:
- Hierarchical linear models (HLM)
- Machine Learning (ML)
- Structural equation modelling (SEM)
- Analysis of Factorial Designs (ANOVA)
Notes:
- This repo contains only materials relating to Practical Applications in R. Though statistics are naturally discussed in many lessons, the focus is generally on the application and not on the theory.
- Please note that some code does not work on purpose and without warning, to force students to learn to debug.
You will need:
- A fresh installation of
R
(preferably version 4.1.1 or above). - RStudio IDE (optional, but recommended).
- The following packages, listed by lesson:
(Bold denotes the first lesson in which the package was used.)
You can install all the packages used by running:
# in alphabetical order:
pkgs <- c(
"afex", "BayesFactor", "bayesplot", "bayestestR", "correlation",
"datawizard", "dplyr", "effectsize", "emmeans", "finalfit", "ggeffects",
"ggplot2", "haven", "Hmisc", "insight", "marginaleffects", "mediation",
"mice", "modelbased", "parameters", "performance", "permuco",
"psych", "psychTools", "pwr", "qqplotr", "ragg", "readxl", "see",
"summarytools", "tidyr", "tidySEM", "tidyverse"
)
install.packages(pkgs, repos = c("https://easystats.r-universe.dev", getOption("repos")))
Package Versions
Run on Windows 11 x64 (build 22621), with R version 4.3.1.
The packages used here:
afex
1.3-0 (CRAN)BayesFactor
0.9.12-4.4 (CRAN)bayesplot
1.10.0 (CRAN)bayestestR
0.13.1.2 (Local version)correlation
0.8.4 (CRAN)datawizard
0.8.0.7 (Local version)dplyr
1.1.2 (CRAN)effectsize
0.8.5 (Local version)emmeans
1.8.7 (CRAN)finalfit
1.0.6 (CRAN)ggeffects
1.3.0.5 (Github: strengejacke/ggeffects)ggplot2
3.4.3 (CRAN)haven
2.5.3 (CRAN)Hmisc
5.1-0 (CRAN)insight
0.19.3.3 (Github: easystats/insight)marginaleffects
0.13.0 (CRAN)mediation
4.5.0 (CRAN)mice
3.16.0 (CRAN)modelbased
0.8.6 (CRAN)parameters
0.21.1 (CRAN)performance
0.10.4 (CRAN)permuco
1.1.2 (CRAN)psych
2.3.6 (CRAN)psychTools
2.3.6 (CRAN)pwr
1.3-0 (CRAN)qqplotr
0.0.6 (CRAN)ragg
1.2.5 (CRAN)readxl
1.4.3 (CRAN)see
0.8.0.2 (Local version)summarytools
1.0.1 (CRAN)tidyr
1.3.0 (CRAN)tidySEM
0.2.4 (CRAN)tidyverse
2.0.0 (CRAN)