R Learning Resources for Psychology Teachers and Students
This is a collection of materials/resources used in the R workshop offered by Dr. Manyu Li for UL Lafayette social science students in 2021. All resources used in the workshop are shared/linked on this page. All weekly notes and codes are licensed under CC-BY-SA 4.0 unless otherwise stated. For other resources redirected from this page, please refer to the authors’ website for licensing information.
Getting Started/Comprehensive Resources:
- Learning to Work With R (Weston and Yee, 2017)
- R Tutorials slides and resources by Weston and Yee (2016, 2017)
- R Programming for Psychology Teachers and Students e-text (Li, 2021)
- Using R for Psychological Research by The Personality Project
- and many many more…
Week 1 - Basic R knowledge
- Week 1 Workshop notes and codes (powered by Google Research Colaborartory no installation is required to run codes)
Learning Objectives
- define/describe basic concepts/components in R, including objects, class, vectors, factors, indexing, data frames, list, and matrices.
- identify basic operators and functions.
- install and request packages.
- subset data frames, select columns/rows from data frames and remove unwanted samples from data.
- create new variables and recode variables.
Homework:
- Install and start RStudio, set a working directory, and import a .csv file as a data frame. You may use your own data file or the sample data file I share in our group email. Ask peer mentor if you have any questions. If they are not resolved, we will discuss the problems at the beginning of Week 2. Consult Chapter 1 and 2 of Li (2021) R Programming for Psychology Teachers and Students
Week 2 - Psychometrics; Variable Manipulation
Learning objectives
- Reverse scale items
- Compute scale scores
- Find scale reliability
- Conduct exploratory and confirmatory factor analysis
Week 3 - Categorical IVs, Tables, and Plots
- Week 3 Workshop notes and codes
- Download .Rmd file to reproduce the notes
Learning objectives
- Use RMarkdown to run codes.
- Conduct t-test/ANOVA analyses
- Conduct post-hoc tests
- Organize results into beautiful tables (e.g., gt, gtsummary)
- Visualize results using ggplot.
- Intro to linear mixed effects model.
Week 4 - Some linear models
Learning objectives
- Conduct regression models (lm)
- Conduct moderation models with simple slope analysis (emmeans)
- Conduct mediation models (psych)
- Conduct path model/SEM analysis (lavaan)
Advanced Resources
RMarkdown, knitr, and papaja
- R Markdown for Psychology Graduate Students (Zaharchuk, 2021)
- papaja: Prepare APA journal articles with R Markdown
- R-eproducible Psychological Science