Two-Way ANOVA using R Tutorial

This tutorial is going to take the theory learned in our Two-Way ANOVA tutorial and walk through how to apply it using R. We will be using the Moore dataset from the carData package. This data frame consists of subjects in a “social-psychological experiment who were faced with manipulated disagreement from a partner of either of low or high status. The subjects could either conform to the partner’s judgment or stick with their own judgment.
Read more

Two-Way ANOVA Tutorial: What to Do with a Significant Interaction?

We discussed how to conduct a 2-way factorial ANOVA in this tutorial, and we talked about the three different types of Sum of Squares here. We will build on these and discuss how to run post hoc analyses when you have a significant interaction. We will use the Moore dataset from the carData package in R. This data frame consists of subjects in a “social-psychological experiment who were faced with manipulated disagreement from a partner of either of low or high status.
Read more

The 3 Different Sum of Squares

You may have noticed that your software output specified a *Type __* Sum of Squares. This tutorial will explain what that means, and the differences between Type I, Type II, and Type III sum of squares using two-way factorial ANOVA as an example. It can be shown that the \(F\) test for a one-way ANOVA is equivalent to comparing the full model to a reduced model. This is equivalent to asking if we are able to improve our prediction of the outcome by including the variable in the model, or if our guesses are just as noisy with the variable as without.
Read more

Two-Way ANOVA Tutorial

This tutorial is going to take what we learned in one-way ANOVA and extend it to two-way ANOVA. In a one-way ANOVA, we have A single dependent variable measured on an interval scale A single independent variable measured on a nominal scale The example used in our one-way ANOVA tutorial was the cook times of four different brands of pasta. The brand of pasta was the independent variable, and the cook time (in minutes) was the dependent variable.
Read more

Estimating SEM using the lavaan package in R

This tutorial shows how to estimate a full structural equation model (SEM) with latent variables using the lavaan package in R. The model consists of three latent variables and eleven manifest variables, as described here. To review, the model to be fit is the following: The data can be accessed from the built-in Bollen dataset in the sem package. library(sem) library(lavaan) data("Bollen") All required packages are loaded first with the library() commands.
Read more

Estimating CFA using the lavaan package in R

This tutorial shows how to estimate a confirmatory factor analysis (CFA) model using the R lavaan package. The model, which consists of two latent variables and eight manifest variables, is described here. To review, the model to be fit is the following: The data can be accessed from the built-in Bollen dataset in the sem package. library(sem) library(lavaan) data("Bollen") All required packages are loaded first with the library() commands. The data are then loaded into the environment using the data() function.
Read more

How to Perform SEM in Mplus

This page describes how to set up code in Mplus to fit a full structural equation model with latent variables. The model consists of three latent variables and eleven manifest variables, as described here. Mplus only reads data in text format, see this post for details on how to prepare a data file for Mplus. The data can be accessed from Github. To review, the model to be fit is the following:
Read more

How to Perform CFA in Mplus

This page describes how to set up code in Mplus to fit a confirmatory factor analysis (CFA) model. The model, which consists of two latent variables and eight manifest variables, is described here. Mplus only reads data in text format, see this post for details on how to prepare a data file for Mplus. The data can be accessed from Github. To review, the model to be fit is the following:
Read more

A Running SEM and CFA Example

Industrialization and Democracy (Bollen, 1989) The CFA and SEM examples are taken from data analyzed in Kenneth Bollen’s (1989) book Structural Equations with Latent Variables. The goal of the model is to determine how democracy and industrialization in 1960 are associated with democracy in 1965. The problem is that there are no good single items that capture the entirety of the concepts of democracy and industrialization. Hence, these concepts are treated as latent (unobserved) variables imperfectly measured by a set of observed indicators.
Read more

How to Prepare Data for Mplus

From SPSS Mplus requires data to be read in from a text file without variable names, with numeric values only, and with missing data coded as a single numeric value, such as -999. A common workflow for preparing data to analyze in Mplus is to perform the variable cleaning in SPSS and then save the data as a text file. This guide shows the appropriate steps using the sample file bollen_sem.
Read more