This section of the site contains miscellaneous examples, explanations, and materials I have found useful in teaching statistics. When I find myself explaining something often, I may add it to this list so I can refer students here for extra information.

## Table of Contents

### R statistical computing environment

Miscellaneous General-Purpose R Functions

Video Series: Brief Introduction to R

Introduction to R Workshop Summary

Cheat Sheet for Beginning R Users

Introduction to R Workshop Plotting Demo

### Regression/ANOVA

Video Series: Conceptual Introduction to Linear Regression

Video Series: Practical Demonstrations of Linear Regression

Video Series: Interactions in Linear Regression Models

Video Series: Regression Interactions - Analysis of Variance

Video Tutorial on Main Effects vs. Interaction in a Regression Model

Types of Main Effects in Factorial ANOVA Models

Notation Conventions for Regression Slopes

Standardized Simple Linear Regression Slopes: Swapping the Predictor and Outcome

Missingness Indicators in Linear Regression

### Miscellaneous

Video Series: Introduction to Statistical Mediation

What are Positive Skew and Negative Skew?

Expected Values of *t* and *F* Statistics

Binary Outcomes: Chi-Squared Test of Independence or Goodness of Fit?

Combined Variance of Two Groups with Equal Numbers of Observations

Three-Way Interaction Plots: When the Halves "Look Different"

## Miscellaneous General-Purpose R Functions

### Keywords: ANOVA, correlation, descriptive, plot, programming, R, regression, software, t-test

This is a download page for my set of miscellaneous general-purpose R functions. I created most of these functions for my own personal use, and I publish and maintain them for my students and anyone else who may be interested. They address a variety of tasks that sometimes come up in psychological data analysis.

## Video Series: Brief Introduction to R

### Keywords: data processing, plot, programming, R, regression, software, video

This video series is a brief introduction to the R statistical computing environment suitable for students with no previous computer programming experience. It was created as part of a statistics class for first-year psychology PhD students in 2023. It consists of seven videos listed on the page linked above and in a Youtube playlist. The R code file and example data files used in this video series are available here: Code and data for brief intro to R [zip].

## R Workshop Videos

### Keywords: data processing, plot, programming, R, regression, software, video

This page presents video recordings from one of my workshops introducing the R statistical computing environment for practical data analysis. Specifically, I ran an eight-hour workshop in Spring 2020 and then split the footage into numerous shorter videos. The next several resources listed below on the current page relate to parts of this workshop, or similar workshops like it that I have run in the past.

## Introduction to R Workshop Summary [pdf]

### Keywords: programming, R, software, workshop materials

This document summarizes the first three units of my workshop series introducing new users to the R statistical computing environment. The full workshop series focuses on statistical computing tasks commonly employed by psychologists, but I have revised this summary for a more general audience. The summary makes reference to example data and syntax files, which can be downloaded as a zip archive here: R Workshop Example Data and Syntax.

## Cheat Sheet for Beginning R Users [pdf]

### Keywords: programming, R, software

This document provides a one-page (front and back) summary of some of the basic functions and commands in R. It focuses on statistical computing tasks commonly employed by psychologists. It is designed to accompany my "R for Psychologists" workshop series, but it should also be comprehensible on its own.

## Introduction to R Workshop Plotting Demo [pdf]

### Keywords: bar plot, box plot, plot, programming, R, scatterplot, software, workshop materials

This document provides examples of several kinds of plots in base R. Please see the step-by-step walkthrough in the associated text file: Base R Plotting Demo. I created these examples for my Introduction to R Workshop Series.

## Video Series: Conceptual Introduction to Linear Regression

### Keywords: correlation, p-values, R, R-squared, regression, simple linear regression, video

This video series is a conceptual introduction to linear regression created as part of a statistics class for first-year psychology PhD students in Fall 2023. It consists of eight videos listed on the page linked above and also in a Youtube playlist.

## Video Series: Practical Demonstrations of Linear Regression

### Keywords: diagnostics, effect size, F-test, R, regression, t-test, video

This video series features demonstrations of fitting, interpreting, and evaluating linear regression models in R. It was created as part of a statistics class for first-year psychology PhD students in 2023. It consists of ten videos listed on the page linked above and in a Youtube playlist. The R code files are available here: Code for regression demos and hypothetical data [zip].

## Video Series: Interactions in Linear Regression Models

### Keywords: conditional association, interaction, main effect, R, regression, simple effect, video

This video series is a demonstration of how to interpret statistical interactions in linear regression models. It was created as part of a statistics class for first-year psychology PhD students in 2023. It consists of seven videos listed on the page linked above and in a Youtube playlist. The R code files are available here: Code for regression interactions and hypothetical data [zip].

## Video Series: Regression Interactions - Analysis of Variance

### Keywords: ANOVA, effect size, F-test, interaction, main effect, R, regression, simple effect, video

This video series is a demonstration of how to apply the Analysis of Variance (ANOVA) framing device to statistical interactions in linear regression models. It was created as part of a statistics class for first-year psychology PhD students in 2023. It consists of eight videos listed on the page linked above and in a Youtube playlist. The R code files and example datasets are available here: Code for ANOVA and hypothetical data [zip].

## Video Tutorial on Main Effects vs. Interaction in a Regression Model

### Keywords: covariate, interaction, main effect, R, regression, simple linear regression, video

On December 18, 2020, I held a live Zoom session explaining the difference between a linear regression model with two main effects and the same model with an interaction, using a silly dog-related example. I split the recording of the session into eight videos in a Youtube playlist. The R code used in these videos is available here: Regression Main Effects vs. Interaction [text].

## Types of Main Effects in Factorial ANOVA Models

### Keywords: ANOVA, F-test, interaction, main effect, R, regression

This page answers questions about types of main effects (or types of sums of squares) in factorial ANOVA models. Why do tests of main effects sometimes differ between software packages? What do "Type II" and "Type III" mean? What are the various ways that a main effect can be defined in the context of an interaction? Unfortunately, the answers are not always straightforward. Defining main effects is often harder than defining the highest-order interaction in a model.

## Notation Conventions for Regression Slopes [pdf]

### Keywords: B, beta, coefficient, estimate, notation, regression, slope

The notation for regression coefficients is often inconsistent. Sometimes, students with prior experience in statistics classes find the notation conventions common in psychology confusing, and vice versa. This table illustrates some of the different symbols that are used to refer to regression coefficients.

## Standardized Simple Linear Regression Slopes: Swapping the Predictor and Outcome Variables

### Keywords: correlation, regression, simple linear regression, slope, standardize, Z-score

When students learn that the least-squares line drawn through standardized versions of two variables has a slope equal to the correlation between those variables, they sometimes wonder how it can be that it does not matter which variable is presented as the predictor and which is presented as the outcome. After all, the unstandardized slope depends on which variable is the predictor and which is the outcome, so why would correlation (standardized slope) be the same regardless? The images on this page attempt to make this concept more intuitive.

## Missingness Indicators in Linear Regression [pdf]

### Keywords: categorical variable, indicator, missing data, numeric variable, regression

Many researchers will happily treat missing values in a categorical variable as their own distinct category, but balk at doing the same for a numeric variable. This document explains what it means to include a missingness indicator in a linear regression model. The implications of using one variable to indicate the missingness of another are often misunderstood. Although this approach must be used cautiously, learning about it helps illustrate general principles about regression.

## Video Series: Introduction to Statistical Mediation

### Keywords: bootstrapping, mediation, R, regression, suppression, video

This video series provides a demonstration and comparison of R packages for statistical mediation. It was created as part of a statistics class for first-year psychology PhD students in 2023. It consists of seven videos listed on the page linked above and in a Youtube playlist. The R code files are available here: Code for mediation examples [zip].

## What are Positive Skew and Negative Skew?

### Keywords: distribution, histogram, skew

This page clarifies what positive and negative skew "look like." Students sometimes find it difficult to remember which is which, so the plots on this page are accompanied by descriptions that explain in general terms what skew is and how to recognize it.

##
Expected Values of *t* and *F* Statistics

### Keywords: distribution, expected value, F-test, t-test

This image illustrates the expected values of a
*t*-distributed random variable and an *F*-distributed random
variable. Under the null hypothesis, the expected value of *t* is 0,
but the expected value of *F* is 1. This is sometimes confusing for
students given that *F* is *t* squared.

## Binary Outcomes: Chi-Squared Test of Independence or Goodness of Fit? [pdf]

### Keywords: binary outcome, chi-squared, expected distribution, goodness of fit, independence

To test whether a categorical variable is related to the presence of a binary characteristic, the appropriate chi-squared test is a test of independence (or association). Some students might be curious why we cannot run a chi-squared test of goodness of fit. After all, the null hypothesis assumes that the characteristic in question will be evenly distributed across the categorical variable, and this sounds very much like an "expected distribution." This document explains why the test of independence is more appropriate and what happens if you run a goodness-of-fit test instead.

## Combined Variance of Two Groups with Equal Numbers of Observations [pdf]

### Keywords: combined variance, repeated measures, SPSS

If we have two groups of *n* observations each, and we know
the mean and sample variance of each group separately, how can we calculate the mean and sample
variance of the combination of the two groups?
This can become an issue when trying to report means and standard deviations
for the main effects in a repeated-measures or mixed-model ANOVA using SPSS.
SPSS does not include as part of its typical descriptive statistics the standard deviation
of the dependent variable across multiple levels of a repeated-mesures factor.

## Three-Way Interaction Plots: When the Halves "Look Different" [pdf]

### Keywords: interaction, plot

A common heuristic for interpreting three-way interaction plots is to look at the "simple" two-way interaction in the left half of the plot and the "simple" two-way interaction in the right half of the plot separately. If these two-way interactions "look different," then we say that there is a three-way interaction. This heuristic does not always work, and this document explains why using an example.