umardhiah / Analysis-of-Factorial-Designs-foR-Psychologists

Lesson files used in the Analysis of Factorial Designs for Psychologists - Practical Applications in R, taught at Ben-Gurion University on the Negev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Analysis of Factorial Designs foR Psychologists

Last updated 2020-06-22.

This Github repo contains all lesson files used in the graduate-level course: Analysis of Factorial Designs foR Psychologists - Practical Applications in R, taught at Ben-Gurion University on the Negev (spring 2019 semester). This course assumes basic competence in R (importing, regression modeling, plotting, etc.), a long the lines of the prerequisite course, Advanced Research Methods foR Psychologists, which can be found here.

The goal is to impart students with the basic tools to fit and evaluate statistical models for factorial designs (w/ plots) using afex, and and conduct follow-up analyses (simple effects, planned contrasts, post-hoc test; w/ plots) using emmeans. Although the focus is on ANOVAs, the materials regarding follow-up analyses (~80% of the course) are applicable to linear mixed models, and even regression with factorial predictors.

Notes:

  • This repo contains only materials relating to Practical Applications in R, and does not contain any theoretical or introductory materials.
  • Please note that some code does not work on purpose, to force students to learn to debug.

Setup

You will need:

  1. A fresh installation of R (preferably version 3.6 or above).
  2. RStudio (optional - but I recommend using an IDE).
  3. The following packages, listed by lesson:
Lesson Packages
01 ANOVA made easy tidyr, afex, emmeans, ggplot2, ggbeeswarm
02 ANCOVA afex
03 analyzing interactions dplyr, afex, emmeans, AMCP, ggplot2
04 custom contrasts afex, emmeans
05 effect sizes afex, emmeans, effectsize, dplyr
06 assumption check and non-parametric tests afex, qqplotr, ggResidpanel, permuco, emmeans, car
07 multiple comparisons afex, emmeans
08 Bayesian ANOVA (and accepting the null) afex, BayesFactor, bayestestR, dplyr, patchwork, ggplot2, emmeans, effectsize, see
09 ANOVA vs (G)LMMs afex, emmeans, patchwork

You can install all the packages used by running:

# in alphabetical order:

pkgs <- c(
  "afex", "AMCP", "BayesFactor", "bayestestR", "car", "dplyr",
  "effectsize", "emmeans", "ggbeeswarm", "ggplot2", "ggResidpanel",
  "patchwork", "permuco", "qqplotr", "see", "tidyr"
)

install.packages(pkgs, dependencies = TRUE)

The package versions used here:

##         afex         AMCP  BayesFactor   bayestestR          car        dplyr 
##       "0.28"      "1.0.0" "0.9.12-4.2"    "0.6.0.1"      "3.0-8"      "1.0.0" 
##   effectsize      emmeans   ggbeeswarm      ggplot2 ggResidpanel    patchwork 
##    "0.3.1.1"      "1.4.7"      "0.6.0"      "3.3.1"      "0.3.0"      "1.0.0" 
##      permuco      qqplotr          see        tidyr 
##      "1.1.0"      "0.0.4"    "0.5.0.1"      "1.1.0"

About

Lesson files used in the Analysis of Factorial Designs for Psychologists - Practical Applications in R, taught at Ben-Gurion University on the Negev


Languages

Language:R 100.0%