• Stars
    star
    123
  • Rank 290,145 (Top 6 %)
  • Language
    R
  • License
    Other
  • Created about 5 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Lesson files for Practical Applications in R for Psychologists.

Practical Applications in R for Psychologists


Last updated 2023-06-11.

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:

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.

Setup

You will need:

  1. A fresh installation of R (preferably version 4.1.1 or above).
  2. RStudio IDE (optional, but recommended).
  3. The following packages, listed by lesson:
Lesson Packages
01 intro
02 data wrangling haven, tidyverse, readxl, dplyr, datawizard, summarytools, parameters, psych, finalfit, Hmisc, mice
03 plotting dplyr, ggplot2, ragg, tidyr
04 hypothesis testing and power effectsize, correlation, BayesFactor, dplyr, pwr, ggplot2
05 regression 101 effectsize, parameters, performance, ggeffects, psychTools
06 categorical predictors and model comparison dplyr, parameters, emmeans, ggeffects, bayestestR, performance
07 moderation and curvilinear dplyr, datawizard, parameters, performance, bayestestR, emmeans, ggeffects, modelbased, ggplot2
08 generalized linear models dplyr, parameters, performance, ggeffects, emmeans, marginaleffects
09 assumption checks and violations ggeffects, performance, see, bayesplot, qqplotr, datawizard, permuco, parameters, insight
10 ANOVA afex, emmeans, effectsize, ggeffects, tidyr
11 mediation mediation, tidySEM

(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 10 x64 (build 22621), with R version 4.2.2.

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 (CRAN)
  • correlation 0.8.4 (CRAN)
  • datawizard 0.7.1 (CRAN)
  • dplyr 1.1.1 (CRAN)
  • effectsize 0.8.3.11 (Local version)
  • emmeans 1.8.6 (CRAN)
  • finalfit 1.0.6 (CRAN)
  • ggeffects 1.2.1.9 (Github: strengejacke/ggeffects)
  • ggplot2 3.4.2 (CRAN)
  • haven 2.5.2 (CRAN)
  • Hmisc 5.0-1 (CRAN)
  • insight 0.19.1 (CRAN)
  • marginaleffects 0.11.2 (CRAN)
  • mediation 4.5.0 (CRAN)
  • mice 3.15.0 (CRAN)
  • modelbased 0.8.6 (CRAN)
  • parameters 0.21.0 (CRAN)
  • performance 0.10.3 (CRAN)
  • permuco 1.1.2 (CRAN)
  • psych 2.3.3 (CRAN)
  • psychTools 2.3.3 (CRAN)
  • pwr 1.3-0 (CRAN)
  • qqplotr 0.0.6 (CRAN)
  • ragg 1.2.5 (CRAN)
  • readxl 1.4.2 (CRAN)
  • see 0.7.5 (CRAN)
  • summarytools 1.0.1 (CRAN)
  • tidyr 1.3.0 (CRAN)
  • tidySEM 0.2.3 (CRAN)
  • tidyverse 2.0.0 (CRAN)