ReCentering Psych Stats
BOOK COVER
PREFACE
Copyright with Open Access
ACKNOWLEDGEMENTS
DATA PREP
1
Scrubbing
1.1
Navigating this Lesson
1.1.1
Learning Objectives
1.1.2
Planning for Practice
1.1.3
Readings & Resources
1.1.4
Packages
1.2
Workflow for Scrubbing
1.3
Research Vignette
1.4
Working the Problem
1.4.1
intRavenous Qualtrics
1.4.2
About the
Rate-a-Recent-Course
Survey
1.4.3
The Codebook
1.5
Scrubbing
1.5.1
Tools for Data Manipulation
1.5.2
Inclusion and Exclusion Criteria
1.5.3
Renaming Variables
1.5.4
Downsizing the Dataframe
1.6
Toward the APA Style Write-up
1.6.1
Method/Procedure
1.7
Practice Problems
1.7.1
Problem #1: Rework the Chapter Problem
1.7.2
Problem #2: Use the
Rate-a-Recent-Course
Survey, Choosing Different Variables
1.7.3
Problem #3: Other data
1.7.4
Grading Rubric
1.8
Bonus Track:
1.8.1
Importing data from an exported Qualtrics .csv file
2
Scoring
2.1
Navigating this Lesson
2.1.1
Learning Objectives
2.1.2
Planning for Practice
2.1.3
Readings & Resources
2.1.4
Packages
2.2
Workflow for Scoring
2.3
Research Vignette
2.4
On Missing Data
2.4.1
Data Loss Mechanisms
2.4.2
Diagnosing Missing Data Mechanisms
2.4.3
Managing Missing Data
2.4.4
Available Information Analysis (AIA)
2.5
Working the Problem
2.5.1
Variable Planning and Preparation
2.5.2
Missing Data Analysis: Whole df and Item level
2.5.3
Analyzing Missing Data Patterns
2.5.4
Can we identify the missing mechanisms?
2.6
Scoring
2.6.1
Reverse scoring
2.7
Missing Analysis: Scale level
2.8
Revisiting Missing Analysis at the Scale Level
2.8.1
Scale Level: Patterns of Missing Data
2.8.2
R-eady for Analysis
2.9
The APA Style Write-Up
2.10
Results
2.11
Practice Problems
2.11.1
Problem #1: Reworking the Chapter Problem
2.11.2
Problem #2: Use the
Rate-a-Recent-Course
Survey, Choosing Different Variables
2.11.3
Problem #3: Other data
2.11.4
Grading Rubric
3
Data Dx
3.1
Navigating this Lesson
3.1.1
Learning Objectives
3.1.2
Planning for Practice
3.1.3
Readings & Resources
3.1.4
Packages
3.2
Workflow for Preliminary Data Diagnostics
3.3
Research Vignette
3.4
Internal Consistency of Scales/Subscales
3.5
Distributional Characteristics of the Variables
3.5.1
Evaluating Univariate Normality
3.5.2
Pairs Panels
3.6
Evaluating Multivariate Normality
3.7
A Few Words on Transformations
3.8
The APA Style Write-Up
3.8.1
Data Diagnostics
3.9
A Quick Regression of our Research Vignette
3.9.1
Results
3.10
Practice Problems
3.10.1
Problem #1: Reworking the Chapter Problem
3.10.2
Problem #2: Use the
Rate-a-Recent-Course
Survey, Choosing Different Variables
3.10.3
Problem #3: Other data
3.10.4
Grading Rubric
3.11
Homeworked Example
3.11.1
Scrubbing
3.11.2
Scoring
3.11.3
Data Dx
3.11.4
Results
4
Multiple Imputation (A Brief Demo)
4.1
Navigating this Lesson
4.1.1
Learning Objectives
4.1.2
Planning for Practice
4.1.3
Readings & Resources
4.1.4
Packages
4.2
Workflow for Multiple Imputation
4.3
Research Vignette
4.4
Multiple Imputation – a Super Brief Review
4.4.1
Steps in Multiple Imputation
4.4.2
Statistical Approaches to Multiple Imputation
4.5
Working the Problem
4.5.1
Selecting and Formatting Variables
4.5.2
Creating Composite Variables
4.5.3
The Multiple Imputation
4.5.4
Creating Scale Scores
4.6
Multiple Regression with Multiply Imputed Data
4.7
Toward the APA Style Write-up
4.7.1
Method/Data Diagnostics
4.7.2
Results
4.8
Multiple imputation considerations
4.9
Practice Problems
4.9.1
Problem #1: Reworking the Chapter Problem
4.9.2
Problem #2: Use the
Rate-a-Recent-Course
Survey, Choosing Different Variables
4.9.3
Problem #3: Other data
4.9.4
Grading Rubric
4.10
Homeworked Example
4.10.1
Scrubbing
MEDIATION
5
Simple Mediation
5.1
Navigating this Lesson
5.1.1
Learning Objectives
5.1.2
Planning for Practice
5.1.3
Readings & Resources
5.1.4
Packages
5.2
Estimating Indirect Effects (the analytic approach often termed
mediation
)
5.2.1
The definitional and conceptual
5.3
Workflow for Simple Mediation
5.4
Super Simple Mediation in
lavaan
: A focus on the mechanics
5.4.1
Simulate Fake Data
5.4.2
Specify Mediation Model
5.4.3
Interpret the Output
5.4.4
A Figure and Table
5.4.5
Results
5.5
Research Vignette
5.5.1
Data Simulation
5.5.2
Scrubbing, Scoring, and Data Diagnostics
5.5.3
Specify the Model in
lavaan
5.5.4
Interpret the Output
5.5.5
A Figure and a Table
5.5.6
Results
5.6
Considering Covariates
5.6.1
A Figure and a Table
5.6.2
APA Style Write-up
5.7
STAY TUNED
5.8
Residual and Related Questions…
5.9
Practice Problems
5.9.1
Problem #1: Rework the research vignette as demonstrated, but change the random seed
5.9.2
Problem #2: Rework the research vignette, but swap one or more variables
5.9.3
Problem #3: Use other data that is available to you
5.9.4
Grading Rubric
5.10
Homeworked Example
5.10.1
Assign each variable to the X, Y, or M roles (ok but not required to include a covariate)
Specify a research model
Import the data and format the variables in the model
Specify and run the lavaan model
Use tidySEM to create a figure that represents your results
Create a table that includes regression output for the M and Y variables
Represent your work in an APA-style write-up
Explanation to grader
Be able to hand-calculate the indirect, direct, and total effects from the a, b, & c’ paths
6
Complex Mediation
6.1
Navigating this Lesson
6.1.1
Learning Objectives
6.1.2
Planning for Practice
6.1.3
Readings & Resources
6.1.4
Packages
6.2
Complex Mediation
6.3
Workflow for Complex Mediation
6.4
Parallel Mediation
6.4.1
A Mechanical Example
6.4.2
Research Vignette
6.4.3
Scrubbing, Scoring, and Data Diagnostics
6.5
Serial Multiple Mediator Model
6.5.1
We stick with the Lewis et al.
(2017)
example, but modify it.
6.5.2
Specify the
lavaan
model
6.5.3
APA Style Writeup
6.6
STAY TUNED
6.7
Troubleshooting and FAQs
6.8
Practice Problems
6.8.1
Problem #1: Rework the research vignette as demonstrated, but change the random seed
6.8.2
Problem #2: Rework the research vignette, but swap one or more variables
6.8.3
Problem #3: Use other data that is available to you
6.8.4
Grading Rubric
6.9
Homeworked Example
Assign each variable to the X, Y, M1, and M2 roles
Import the data and format the variables in the model
Specify and run the lavaan model
Use tidySEM to create a figure that represents your results
Create a table that includes a summary of the effects (indirect, direct, total, total indirect) as well as contrasts
Represent your work in an APA-style write-up
Explanation to grader
Be able to hand-calculate the indirect, direct, and total effects from the a, b, & c’ paths
A homework idea
MODERATION
7
Simple Moderation in OLS and MLE
7.1
Navigating this Lesson
7.1.1
Learning Objectives
7.1.2
Planning for Practice
7.1.3
Readings & Resources
7.1.4
Packages
7.2
On
Modeling
: Introductory Comments on the simultaneously invisible and paradigm-shifting transition we are making
7.2.1
NHST versus modeling
7.2.2
Introducing:
The Model
7.3
OLS to ML for Estimation
7.3.1
Ordinary least squares (OLS)
7.3.2
Maximum likelihood estimation (MLE): A brief orientation
7.3.3
OLS and MLE Comparison
7.3.4
Hayes and PROCESS (aka conditional process analysis)
7.4
Introducing the
lavaan
package
7.4.1
The FIML magic for which we have been waiting
7.5
Picking up with Moderation
7.6
Workflow for a Simple Moderation
7.6.1
Research Vignette
7.6.2
Scrubbing, Scoring, and Data Diagnostics
7.7
Working the Simple Moderation with OLS and MLE
7.7.1
OLS with
lm()
7.7.2
MLE with
lavaan::sem()
7.7.3
Tabling the data
7.7.4
APA Style Writeup
7.8
STAY TUNED
7.9
Residual and Related Questions…
7.10
Practice Problems
7.10.1
Problem #1: Rework the research vignette as demonstrated, but change the random seed
7.10.2
Problem #2: Rework the research vignette, but swap one or more variables
7.10.3
Problem #3: Use other data that is available to you
7.10.4
Grading Rubric
7.11
Bonus Track:
7.12
Homeworked Example
Assign each variable to the X, Y, and W roles
Import the data and format the variables in the model
Specify and run the OLS/
lm()
model
Probe the interaction with the simple slopes and Johnson-Neyman approaches
Create an interaction figure
Create a table (a package-produced table is fine)
Create an APA style write-up of the results
Repeat the analysis in
lavaan
(specify the model to include probing the interaction)
Create a model figure
Create a table
7.12.1
Note similarities and differences in the OLS results
Represent your work in an APA-style write-up
CONDITIONAL PROCESS ANALYSIS
8
Moderated Mediation
8.1
Navigating this Lesson
8.1.1
Learning Objectives
8.1.2
Planning for Practice
8.1.3
Readings & Resources
8.1.4
Packages
8.2
Conditional Process Analysis
8.2.1
The definitional and conceptual
8.3
Workflow for Moderated Mediation
8.4
Research Vignette
8.4.1
Simulating the data from the journal article
8.4.2
Scrubbing, Scoring, and Data Diagnostics
8.4.3
Quick peek at the data
8.5
Working the Moderated Mediation
8.5.1
Piecewise Assembly of the Moderated Mediation
8.6
The Moderated Mediation: A Combined analysis
8.6.1
Specification in
lavaan
8.6.2
Beginning the interpretation
8.6.3
Tabling the data
8.6.4
Model trimming
8.6.5
APA Style Write-up
8.7
STAY TUNED
8.8
Residual and Related Questions…
8.9
Practice Problems
8.9.1
Problem #1: Rework the research vignette as demonstrated, but change the random seed
8.9.2
Problem #2: Rework the research vignette, but swap one or more variables
8.9.3
Problem #3: Use other data that is available to you
8.9.4
Grading Rubric
8.10
Homeworked Example 1: A moderation on the
a
path
Describing thy overall model hypothesis, assign each variable to the X, Y, M, and W roles
Import the data and format the variables in the model
Using a piecewise approach, run each of the simple models in the grander design
Use tidySEM to create a figure
Create a table that includes regression output for the M and Y variables and the moderated effects
APA Style Write-up
8.11
Homeworked Example 2: A moderation on the
b
path
Describing they overall model hypothesis, assign each variable to the X, Y, M, and W roles
Import the data and format the variables in the model
Using a piecewise approach, run each of the simple models in the grander design
Use tidySEM to create a figure
Create a table that includes regression output for the M and Y variables and the moderated effects
APA Style Write-up
STRUCTURAL EQUATION MODELING
9
Establishing the Measurement Model
9.1
Navigating this Lesson
9.1.1
Learning Objectives
9.1.2
Planning for Practice
9.1.3
Readings & Resources
9.1.4
Packages
9.2
Introduction to Structural Equation Modeling (SEM)
9.3
Workflow for Evaluating a Structural Model
9.4
The Measurement Model: Specification and Evaluation
9.4.1
Degrees of Freedom and Model Identification
9.5
Research Vignette
9.5.1
Simulating the data from the journal article
9.6
Scrubbing, Scoring, and Data Diagnostics
9.7
Specifying the Measurement Model in
lavaan
9.8
Interpreting the Output
9.8.1
Global Fit Indices
9.9
Parceling
9.9.1
The Pros and Cons of Parceling
9.9.2
Practical Procedures for Parceling
9.10
Parceling with Subscale Scores
9.10.1
Measurement Model with Subscale Parcels
9.10.2
Measurement Model with Just-Identified Random Parcels
9.10.3
APA Style Write-up of the Results
9.11
Residual and Related Questions…
9.11.1
Wait! Why did we do this?
9.11.2
What if one of my variables only has one or two indicators?
9.11.3
What if I have missing data?
9.12
Practice Problems
9.12.1
Problem #1: Rework the research vignette as demonstrated, but change the random seed
9.12.2
Problem #2: Rework the research vignette, but swap one or more variables
9.12.3
Problem #3: Try something entirely new.
9.12.4
Grading Rubric
9.13
Homeworked Example
Identify the structural model you will evaluate
Specify a research model
Import the data and format the variables in the model
Specify and evaluate a measurement model with all items as indicators
Interpret the results
Specify and evaluate a measurement model with either the subscale or randomly assigned to 3 parcels approaches
Interpret the results
Make notes about similarities and differences in the all-items and parceled approaches
APA style results with table and figure
Explanation to grader
10
Specifying and Evaluating the Structural Model
10.1
Navigating this Lesson
10.1.1
Learning Objectives
10.1.2
Planning for Practice
10.1.3
Readings & Resources
10.1.4
Packages
10.2
Evaluating Structural Models
10.3
Workflow for Evaluating a Structural Model
10.4
Research Vignette
10.4.1
Simulating the data from the journal article
10.5
Scrubbing, Scoring, and Data Diagnostics
10.6
Script for Specifying Models in
lavaan
10.7
Quick Specification of the Measurement Model
10.8
The Structural Model: Specification and Evaluation
10.8.1
Model Identification
10.8.2
APA Style Write-up of the Results
10.9
What About Alternative Models?
10.9.1
Swapping the Mediator and the Outcome
10.9.2
REMS as a Predictor of Both CMI and PWB
10.9.3
What if we allowed PWB and CMI to co-vary?
10.9.4
Model comparisons
10.10
STAY TUNED
10.11
Practice Problems
10.11.1
Problem #1: Change the random seed
10.11.2
Problem #2: Swap one or more of the variables
10.11.3
Problem #3: Try something entirely new.
10.11.4
Grading Rubric
10.12
Homeworked Example
Identify the structural model you will evaluate
Specify a research model
Import the data and format the variables in the model
Specify and evaluate a measurement model that you have established
Specify and evaluate a
structural
model
Respecify and evaluate an
alternative
structural model
10.12.1
Conduct a formal comparison of
global
fit.
APA style results with table and figure
Explanation to grader
A homework suggestion
11
SEM: Model Respecifications
11.1
Navigating this Lesson
11.1.1
Learning Objectives
11.1.2
Planning for Practice
11.1.3
Readings & Resources
11.1.4
Packages
11.2
Respecifying Structural Models
11.2.1
Model Building
11.2.2
Model Trimming
11.2.3
Restating Approaches to Respecification
11.3
Workflow for Evaluating a Structural Model
11.4
Research Vignette
11.4.1
Simulating the data from the journal article
11.5
Scrubbing, Scoring, and Data Diagnostics
11.6
Script for Specifying Models in
lavaan
11.7
Quick Specification of the Measurement Model
11.8
Specifying and Evaluating the Hypothesized Structural Model
11.8.1
Model Identification for the Hypothesized (Original) Model
11.9
Model Building
11.10
Model Trimming
11.10.1
APA Style Write-up of the Results
11.11
STAY TUNED
11.12
Practice Problems
11.12.1
Problem #1: Change the random seed
11.12.2
Problem #2: Swap one or more of the variables
11.12.3
Problem #3: Try something entirely new.
11.13
Homeworked Example
Identify the structural model you will evaluate
Import the data and format the variables in the model.
Specify and evaluate a
measurement
model that you have established.
Specify and evaluate a
structural
model
Use modification indices to add at least one path or covariance
Conduct a formal comparison of
global
fit between the original and respecified model
Using the strength and significance of regression weights as a guide, trim at least path or covariance
Conduct a formal comparison of
global
fit between the original (or built) and trimmed model
APA style results with table(s) and figure(s)
Explanation to grader
MULTILEVEL MODELING
12
Nested Within Groups
12.1
Navigating this Lesson
12.1.1
Learning Objectives
12.1.2
Planning for Practice
12.1.3
Readings & Resources
12.1.4
Packages
12.2
Multilevel Modeling: Nested within Groups
12.2.1
The dilemma of aggregation and disaggregation
12.2.2
Multilevel modeling: The definitional and conceptual
12.3
Workflow
12.4
Research Vignette
12.4.1
Simulating the data from the journal article
12.5
Working the Problem (and learning MLM)
12.5.1
Data diagnostics
12.5.2
Levels
12.5.3
Centering
12.5.4
Model Building
12.5.5
Final Model
12.5.6
Oh right, the Formulae
12.5.7
Power in Multilevel Models
12.5.8
APA Style Writeup
12.6
A Conversation with Dr. Lefevor
12.7
Practice Problems
12.7.1
Problem #1: Rework the research vignette as demonstrated, but change the random seed
12.7.2
Problem #2: Rework the research vignette, but swap one or more variables
12.7.3
Problem #3: Use other data that is available to you
12.7.4
Grading Rubric
12.8
Homeworked Example
Identify the multilevel model you will evaluate and assign each predictor variable to the L1 or L2 roles.
Import the data and format the variables in the model.
12.8.1
Produce multilevel descriptives and a multilevel correlation matrix.
Use a compositional effects approach to centering to group-mean center the L1 variables and then “bring back” their aggregate as an L2 variable
Model 1: empty model
Model 2: Add L1 predictors
Model 3: Add L2 predictors
Model 4: Add a cross-level interaction
Create a tab_model table with the final set of models
12.8.2
Use Arend & Schäfer’s
(2019)
power tables to determine the power of the L1, L2, and cross-level interactions in your model
Create a figure to represent the result
APA Style writeup
Explanation to grader
13
Preliminary (OLS style) Exploration of Longitudinal Growth
13.1
Navigating this Lesson
13.1.1
Learning Objectives
13.1.2
Planning for Practice
13.1.3
Readings & Resources
13.1.4
Packages
13.2
Change-Over-Time Analytics
13.3
Workflow for Longitudinal MLM
13.4
Research Vignette
13.4.1
Simulating the data from the journal article
13.5
Longitudinal Exploration
13.5.1
The Structure of the Data File as the First Step in Understanding Longitudinal Modeling
13.5.2
Job#1 is to get our data from person-level into person-period
13.5.3
Multilevel Descriptive Statistics and Correlations
13.5.4
Empirical Growth Plots
13.5.5
Plotting a Trajectory as Summary of Each Person’s Empirical Growth Record
13.5.6
Examining intercepts, slopes, and their relationship
13.5.7
Exploring the relationship between Change and Time-Invariant Predictors
13.5.8
The Relationship between OLS-Estimated Trajectories and Substantive Predictors
13.5.9
APA Style Writeup
13.6
Observations about the Social and Cultural Responsivity of the Project
13.7
Practice Problems
13.7.1
Problem #1: Rework the research vignette as demonstrated, but change the random seed
13.7.2
Problem #2: Rework the research vignette using a different outcome variable
13.7.3
Problem #3: Use other data that is available to you
13.7.4
Grading Rubric
13.8
Simulated Data when Depression is the Outcome
13.9
Homeworked Example
Identify and describe the variables in the model; there should be a time-varying DV and predictor as well as an L2 predictor
### Import the data and format the variables in the model
Restructure the dataset from wide to long (or from long to wide)
13.9.1
Produce multilevel descriptive statistics and correlation matrix
Explore data with an unfitted model
Explore data with a model fitted with a linear growth trajectory
Explore data with the fitted (or unfitted) data identified by the L2 predictor
Provide a write-up of what you found in this process
Explanation to grader
14
A Basic Longitudinal Model
14.1
Navigating this Lesson
14.1.1
Learning Objectives
14.1.2
Planning for Practice
14.1.3
Readings & Resources
14.1.4
Packages
14.2
The Basic, Longitudinal, Multilevel Model
14.2.1
The definitional and conceptual
14.3
Workflow for a Basic, Longitudinal, Multilevel Model
14.4
Research Vignette
14.4.1
Simulating the data from the journal article
14.5
Working the Longitudinal, Multilevel Model
14.5.1
A Moment on Estimators
14.5.2
Two Unconditional Multilevel Models for Change
14.6
Analysis
14.6.1
Model 1: The
unconditional
means model (aka the “empty model” or intercept-only model)
14.6.2
A moment on
lmer()
syntax
14.6.3
Model 2: The unconditional growth model
14.6.4
Another moment on
lmer()
syntax
14.6.5
A Taxonomy of Statistical Models
14.6.6
Model 3: The uncontrolled effects of sexual identity
14.6.7
Model 4: The effects of religious affiliation
14.6.8
Model 5: Model trimming
14.7
Evaluating the “Tenability” (quality) of the Final Model
14.7.1
The Deviance Statistics
14.7.2
Comparing Nonnested Models with Information Criteria
14.7.3
Evaluating the Model’s Assumptions
14.8
APA Style Writeup
14.9
Residual and Related Questions…
14.10
Practice Problems
14.10.1
Problem #1: Rework the research vignette as demonstrated, but change the random seed
14.10.2
Problem #2: Rework the research vignette, but use the depression variable as an outcome
14.10.3
Problem #3: Use other data that is available to you
14.10.4
Grading Rubric
15
Calendrical Time (and Missingness) in MLMs
15.1
Navigating this Lesson
15.1.1
Learning Objectives
15.1.2
Planning for Practice
15.1.3
Readings & Resources
15.1.4
Packages
15.2
Exploring Variants of Time and Balance
15.3
Research Vignette
15.3.1
Simulating the data from the journal article
15.4
More Simulation – Appointment Dates
15.5
Reworking Lefevor et al. using Calendrical Time (and Unbalanced Data)
15.5.1
Creating Time Intervals
15.5.2
Wide to Long
15.5.3
MLM is for unbalanced designs
15.5.4
Abbreviated OLS Style Exploration
15.5.5
Rebuilding the Model (Unstructured Time, Unbalanced Design)
15.6
Structured Time: Reworking the Vignette with Index
15.7
APA Style Writeup
15.8
Residual and Related Questions…
15.8.1
What did we gain/lose by using Weeks or SessNum (unstructured) versus Index (structured) to mark time?
15.8.2
How did the unbalanced time impact the analysis and results?
15.9
Practice Problems
15.9.1
Problem #1: Rework this Lesson’s Example by Changing the Time Metric to Days or Months
15.9.2
Problem #2: Compare balanced and unbalanced designs
15.9.3
Problem #3: Experiment with time and balance/unbalance in data that is available to you
15.10
Bonus Track:
15.10.1
FAQs
REFERENCES
Published with bookdown
ReCentering Psych Stats: Multivariate Modeling
STRUCTURAL EQUATION MODELING