PSY 771 — R Scripts

Getting Started

Work through these two scripts before the first class session.

Script 1
What R is, how to install it, and the core building blocks — arithmetic, objects, vectors, matrices, and data frames. Start here if you are new to R.
Script 2
A complete data analysis workflow: importing a real psychology dataset, computing descriptive statistics with psych::describe(), testing correlations with cor.test(), and fitting a multiple regression with lm().
Script 3
Standardizing scores with the z-score formula and scale(), finding areas under the normal curve with pnorm(), constructing 80/90/95/99% confidence intervals with qnorm(), and writing a custom z.test() function in R.
Script 4
One-sample, independent samples (equal and Welch), and paired t-tests using a reading intervention dataset. Includes Levene's test for homogeneity of variance, bar graphs with error bars, and a demonstration of how the t-distribution converges to z as sample size increases.
Weekly Scripts
Coming soon
Scripts for one-way ANOVA, factorial ANOVA, repeated measures ANOVA, and mixed ANOVA will be posted here as we progress through the course.