ReCentering Psych Stats: Analysis of Variance
BOOK COVER
PREFACE
Copyright with Open Access
ACKNOWLEDGEMENTS
1
Introduction
1.1
What to expect in each chapter
1.2
Strategies for Accessing and Using this OER
1.3
If You are New to R
1.4
When Code Fails
1.5
Introduction to the Data Set Used for Homeworked Examples
1.5.1
The Data Set
2
Ready_Set_R
2.1
Navigating this Lesson
2.1.1
Learning Objectives
2.2
downloading and installing R
2.2.1
So many paRts and pieces
2.2.2
oRienting to R Studio (focusing only on the things we will be using first and most often)
2.3
best pRactices
2.3.1
Everything is documented in the .rmd file
2.3.2
Setting up the file
2.3.3
Script in chunks and everything else in the “inline text” sections
2.3.4
Managing packages
2.3.5
Upload the data
2.4
quick demonstRation
2.5
the knitted file
2.6
tRoubleshooting in R maRkdown
2.7
just
why
have we tRansitioned to R?
2.8
stRategies for success
2.9
Resources for getting staRted
2.10
Practice Problems
2.11
Homeworked Example
3
Preliminary Analyses
3.1
Navigating this Lesson
3.1.1
Learning Objectives
3.1.2
Planning for Practice
3.1.3
Readings & Resources
3.2
Research Vignette
3.3
Variable Types (Scale of Measurement)
3.3.1
Measurement Scale
3.3.2
Corresponding Variable Structure in R
3.4
Descriptive Statistics
3.4.1
Measures of Central Tendency
3.5
Variability
3.5.1
Range
3.5.2
Percentiles, Quantiles, Interquartile Range
3.5.3
Deviations around the Mean
3.5.4
Variance
3.5.5
Standard Deviation
3.6
Are the Variables Normally Distributed?
3.6.1
Skew and Kurtosis
3.6.2
Shapiro-Wilk Test of Normality
3.7
Relations between Variables
3.8
Shortcuts to Preliminary Analyses
3.8.1
SPLOM
3.8.2
apaTables
3.9
An APA Style Writeup
3.10
Practice Problems
3.10.1
Problem #1: Change the Random Seed
3.10.2
Problem #2: Swap Variables in the Simulation
3.10.3
Problem #3: Use (or Simulate) Your Own Data
3.10.4
Grading Rubrics
3.11
Homeworked Example
3.11.1
Working the Problem with R and R Packages
3.11.2
Hand Calculations
T
-TESTS
4
One Sample
t
-tests
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
z
before
t
4.2.1
Simulating a Mini Research Vignette
4.2.2
Raw Scores,
z
-scores, and Proportions
4.2.3
Determining Probabilities
4.2.4
Percentiles
4.2.5
Transforming Variables to Standard Scores
4.2.6
The One-Sample
z
test
4.3
Introducing the One-Sample
t
-test
4.3.1
Workflow for the One-Sample
t
-test
4.4
Research Vignette
4.4.1
Data Simulation
4.4.2
Quick Peek at the Data
4.5
Working the One Sample
t
-test (by hand)
4.5.1
Stating the Hypothesis
4.5.2
Calculating the
t
-test
4.6
Working the One-Sample
t
-test with R Packages
4.6.1
Evaluating the Statistical Assumptions
4.6.2
Computing the
t
-test
4.7
APA Style Results
4.8
Power in One-Sample
t
-tests
4.9
Practice Problems
4.9.1
Problem #1: Rework the research vignette as demonstrated, but change the random seed
4.9.2
Problem #2: Rework the research vignette, but change something about the simulation
4.9.3
Problem #3: Use other data that is available to you
4.9.4
Grading Rubric
4.10
Homeworked Example
4.10.1
Working the Problem with R and R Packages
4.10.2
Hand Calculations
5
Independent Samples
t
-test
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
Introducing the Independent Samples
t
-Test
5.2.1
Workflow for Independent Samples
t
-Test
5.3
Research Vignette
5.3.1
Data Simulation
5.3.2
Quick Peek at the Data
5.4
Working the Independent Samples
t
-Test (by hand)
5.4.1
Stating the Hypothesis
5.4.2
Calculating the
t
-Test
5.5
Working the Independent Samples
t
-Test with R Packages
5.5.1
Evaluating the Statistical Assumptions
5.5.2
Computing the Independent Samples
t
-Test
5.5.3
What if we had violated the homogeneity of variance assumption?
5.6
APA Style Results
5.7
Power in Independent Samples
t
-tests
5.8
Practice Problems
5.8.1
Problem #1: Rework the research vignette as demonstrated, but change the random seed
5.8.2
Problem #2: Rework the research vignette, but change something about the simulation
5.8.3
Problem #3: Rework the research vignette, but swap one or more variables
5.8.4
Problem #4: Use other data that is available to you
5.8.5
Grading Rubric
5.9
Homeworked Example
5.9.1
Working the Problem with R and R Packages
5.9.2
Hand Calculations
6
Paired Samples
t
-test
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
Introducing the Paired Samples
t
-test
6.2.1
Workflow for Paired Samples
t
-test
6.3
Research Vignette
6.3.1
Simulating Data for the Paired Samples
t
-test
6.3.2
Quick Peek at the Data
6.4
Working the Paired Samples
t
-Test (by hand)
6.4.1
Stating the Hypothesis
6.4.2
Calculating the Paired Samples
t
-Test
6.5
Working the Paired Samples
t
-Test with R Packages
6.5.1
Evaluating the Statistical Assumptions
6.5.2
Computing the Paired Samples
t
-Test
6.6
APA Style Results
6.7
Power in Paired Samples
t
-Tests
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 change something about the simulation
6.8.3
Problem #3: Rework the research vignette, but swap one or more variables
6.8.4
Problem #4: Use other data that is available to you
6.8.5
Grading Rubric
6.9
Homeworked Example
6.9.1
Working the Problem with R and R Packages
6.9.2
Hand Calculations
ANALYSIS OF VARIANCE
7
One-way ANOVA
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
Workflow for One-Way ANOVA
7.3
Research Vignette
7.3.1
Data Simulation
7.3.2
Quick Peek at the Data
7.4
Working the Oneway ANOVA (by hand)
7.4.1
Sums of Squares Total
7.4.2
Sums of Squares for the Model (or Between)
7.4.3
Sums of Squares Residual (or within)
7.4.4
Relationship between
\(SS_T\)
,
\(SS_M\)
, and
\(SS_R\)
.
7.4.5
Mean Squares Model & Residual
7.4.6
Calculating the
F
Statistic
7.4.7
Source Table Games
7.5
Working the One-Way ANOVA with R Packages
7.5.1
Evaluating the Statistical Assumptions
7.5.2
Computing the Omnibus ANOVA
7.5.3
Follow-up to the Omnibus
F
7.5.4
What if we Violated the Homogeneity of Variance test?
7.6
APA Style Results
7.7
Power Analysis
7.8
A Conversation with Dr. Tran
7.9
Practice Problems
7.9.1
Problem #1: Play around with this simulation.
7.9.2
Problem #2: Conduct a one-way ANOVA with the
moreTalk
dependent variable.
7.9.3
Problem #3: Try something entirely new.
7.9.4
Grading Rubric
7.10
Homeworked Example
7.10.1
Working the Problem with R and R Packages
7.10.2
Hand Calculations
8
Factorial (Between-Subjects) ANOVA
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
Introducing Factorial ANOVA
8.2.1
Workflow for Two-Way ANOVA
8.3
Research Vignette
8.3.1
Data Simulation
8.3.2
Quick peek at the data
8.4
Working the Factorial ANOVA (by hand)
8.4.1
Sums of Squares Total
8.4.2
Sums of Squares for the Model
8.4.3
Sums of Squares Residual (or within)
8.4.4
A Recap on the Relationship between
\(SS_T\)
,
\(SS_M\)
, and
\(SS_R\)
8.4.5
Calculating SS for Each Factor and Their Products
8.4.6
Source Table Games!
8.4.7
Interpreting the results
8.5
Working the Factorial ANOVA with R Packages
8.5.1
Evaluating the statistical assumptions
8.5.2
Evaluating the Omnibus ANOVA
8.5.3
Follow-up to a Significant Interaction Effect
8.5.4
Investigating Main Effects
8.6
APA Style Results
8.6.1
Comparing Our Results to Rhamdani et al.
(2018)
8.7
Options for Violation of Statistical Assumptions
8.7.1
Violating the Assumption of Normality
8.7.2
Violating the Homogeneity of Variance Assumption
8.8
Power Analysis
8.8.1
Post Hoc Power Analysis
8.8.2
Estimating Sample Size Requirements
8.9
Practice Problems
8.9.1
Problem #1: Play around with this simulation.
8.9.2
Problem #2: Conduct a factorial ANOVA with the
positive evaluation
dependent variable.
8.9.3
Problem #3: Try something entirely new.
8.9.4
Grading Rubric
8.10
Homeworked Example
8.10.1
Working the Problem with R and R Packages
8.10.2
Hand Calculations
9
One-Way Repeated Measures ANOVA
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
Introducing One-way Repeated Measures ANOVA
9.2.1
Workflow for Oneway Repeated Measures ANOVA
9.3
Research Vignette
9.3.1
Data Simulation
9.3.2
Quick peek at the data
9.4
Working the One-Way Repeated Measures ANOVA (by hand)
9.4.1
Sums of Squares Total
9.4.2
Sums of Squares Within for Repated Measures ANOVA
9.4.3
Sums of Squares Model – Effect of Time
9.4.4
Sums of Squares Residual
9.4.5
Sums of Squares Between
9.4.6
Mean Squares Model & Residual
9.4.7
F
ratio
9.5
Working the One-Way Repeated Measures ANOVA with R packages
9.5.1
Testing the assumptions
9.5.2
Computing the Test Statistic
9.5.3
Follow-up to Omnibus F
9.6
APA Style Results
9.6.1
Comparison with Amodeo et al.
(2018)
9.7
Power Analysis
9.8
Practice Problems
9.8.1
Problem #1: Change the Random Seed
9.8.2
Problem #2: Increase
N
9.8.3
Problem #3: Try Something Entirely New
9.8.4
Grading Rubric
9.9
Homeworked Example
9.9.1
Working the Problem with R and R Packages
9.9.2
Hand Calculations
10
Mixed Design ANOVA
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
Introducing Mixed Design ANOVA
10.2.1
Workflow for the Mixed Design ANOVA
10.3
Research Vignette
10.3.1
Data Simulation
10.3.2
Quick peek at the data
10.4
Working the Mixed Design ANOVA with R packages
10.4.1
Exploring data and testing assumptions
10.4.2
Omnibus ANOVA
10.4.3
Follow-up to Omnibus Tests
10.4.4
Simple main effect of condition within wave
10.4.5
Simple main effect of wave within condition
10.4.6
If we only had a main effect
10.4.7
APA Style Write-up of the Results
10.5
Power in Mixed Design ANOVA
10.6
Practice Problems
10.6.1
Problem #1: Play around with this simulation.
10.6.2
Problem #2: Conduct a mixed design ANOVA with a different dependent variable.
10.6.3
Problem #3: Try something entirely new.
10.6.4
Grading Rubric
10.7
Homeworked Example
10.7.1
Working the Problem with R and R Packages
11
Analysis of Covariance
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
Introducing Analysis of Covariance (ANCOVA)
11.2.1
Workflow for ANCOVA
11.3
Research Vignette
11.3.1
Data Simulation
11.4
Working the ANCOVA – Scenario #1: Controlling for the pretest
11.4.1
Preparing the data
11.4.2
Evaluating the statistical assumptions
11.4.3
Calculating the Omnibus ANOVA
11.4.4
Post-hoc pairwise comparisons (controlling for the covariate)
11.4.5
APA style results for Scenario 1
11.5
Working the ANCOVA – Scenario #2: Controlling for a confounding or covarying variable
11.5.1
Preparing the data
11.5.2
Evaluating the statistical assumptions
11.5.3
Calculating the Omnibus ANOVA
11.5.4
Post-hoc pairwise comparisons (controlling for the covariate)
11.5.5
APA style results for Scenario 2
11.6
More (and a recap) on covariates
11.7
Practice Problems
11.7.1
Problem #1: Play around with this simulation.
11.7.2
Problem #2: Conduct a one-way ANCOVA with the DV and covariate at post2.
11.7.3
Problem #3: Try something entirely new.
11.7.4
Grading Rubric
11.8
Homeworked Example
11.8.1
Working the Problem with R and R Packages
CORRELATION & REGRESSION
12
Correlation
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
Introducing correlations
12.2.1
Workflow for Choosing which Correlation
12.3
Assumptions of correlation
12.4
Research Vignette
12.4.1
Data Simulation
12.4.2
Data Visualization
12.5
Working Pearson’s
r
(by hand)
12.5.1
Stating the Hypothesis
12.5.2
Calculating Pearson’s
r
12.6
Finding a Correlation in R
12.6.1
Evaluating the Statistical Assumptions and Choosing a Test
12.6.2
Computing Pearson’s
r
12.7
Correlation Matrices
12.8
APA Style Results
12.9
Power for Pearson’s
\(r\)
correlations
12.10
Other Types of Correlations
12.10.1
Spearman and Kendall
12.11
Practice Problems
12.11.1
Problem #1: Rework the research vignette as demonstrated, but change the random seed
12.11.2
Problem #2: Rework the research vignette, but change something about the simulation
12.11.3
Problem #3: Rework the research vignette, but swap one or more variables
12.11.4
Problem #4: Use other data that is available to you
12.11.5
Grading Rubric
APPENDICES
13
Type I Error
13.1
Type I Error Defined
13.2
Methods for Managing Type I Error
13.2.1
LSD (Least Significant Difference) Method
13.2.2
Traditional Bonferroni
13.2.3
Tukey HSD
13.2.4
Holms Sequential Bonferroni
14
Examples for Follow-up to Factorial ANOVA
14.1
Research Vignette
14.1.1
Quick Resimulating of the Data
14.2
Analysis of Simple Main Effects with Orthogonal Contrasts
14.3
Analysis of Simple Main Effects with a Polynomial Trend
14.4
All Possible Post Hoc Comparisons
15
One-Way Repeated Measures with a Multivariate Approach
15.1
Research Vignette
15.1.1
Data Simulation
15.2
Computing the Omnibus F
15.2.1
Univariate Results
15.2.2
Multivariate Results
15.2.3
A Brief Commentary on Wrappers
REFERENCES
Published with bookdown
ReCentering Psych Stats
CORRELATION & REGRESSION