A Minimal Book Example
1
About
1.1
What different things mean
1.2
Additional resources
2
Basic Conventions
2.1
Commenting Code
2.2
The argument for syntax over dropdowns
2.3
What is a Function?
2.4
Installing and Using Packages
2.5
Setting a Working Directory
2.6
Object Assignment Operator
2.7
Datasets
2.8
Reading in Outside Files
Excel (.xlsx, .xls)
Delimited files (.tsv, .csv)
SAS
SPSS
2.9
Quotes
3
Lists and Dataframes
3.1
Lists
3.2
Dataframes
3.2.1
Look at first or last few rows
3.2.2
Referencing Specific Columns
3.2.3
Referencing Specific Values
3.3
Change Variable Name
3.4
Generating a Count Table
4
Intro Stat Functions
4.1
Mode
4.2
Psych Package for Data Summary
T-Tests
5
One Sample t-test
5.1
Get Descriptives
5.2
Check Assumptions
5.3
Running the One Sample T-Test: Two-tailed
5.4
Running the One Sample T-Test: One-tailed
5.5
Calculating Cohen’s d
6
Independent Samples T-Test
6.1
Descriptives
6.2
Check Assumptions
6.2.1
Normality
Histogram
QQ Plot
Detrended QQ Plot
6.2.2
Homogeneity of Variance
6.3
Perform the T-Test
6.4
Calculating Cohen’s d
7
Repeated Measures t-test
7.1
Descriptives
7.2
Check Assumptions
7.2.1
Normality
Histogram
QQ Plot
Detrended QQ Plot
7.3
Perform the T-test
7.4
Calculating Cohen’s d
8
Correlation and Regression
8.1
Correlation
8.1.1
Examine the Data - Correlation
8.1.2
Run a Correlation
Correlation between a single pair of variables
Correlation matrix
8.2
Regression
8.2.1
Examine the Data - Regression
8.2.2
Run the Regression
ANOVAs
9
One-Way Between Subjects ANOVA
9.1
Descriptive Statistics
9.2
Assumptions
9.2.1
Normality
Shapiro-Wilk
Histogram
QQ Plot
Detrended QQ Plot
9.2.2
Homogeneity of Variance
9.3
Run the one-way between subjects ANOVA
AOV
LM
9.4
Post-hoc tests
9.4.1
Pairwise comparisons
9.4.2
Using emmeans() for Pairwise Comparisons
9.4.3
Running each adjustment method separately
Bonferroni
Tukey’s HSD
Scheffe adjustment
9.4.4
Custom contrasts
10
One-Way Within Subjects ANOVA
10.1
Descriptive Statistics
10.2
Assumptions
10.2.1
Normality
Shapiro-Wilk
Histogram
QQ Plot
Detrended QQ Plot
10.2.2
Sphericity
10.3
Run the One-Way Within Subjects ANOVA
10.3.1
Estimated Means
10.3.2
Using emmeans() for Pairwise Comparisons
10.3.3
Custom contrasts
11
Two-Way Between Subjects ANOVA
11.1
Descriptive Statistics
11.2
Assumptions
11.2.1
Normality
Shapiro-Wilk
Histogram
QQ Plot
Detrended QQ Plot
11.2.2
Homogeneity of Variance
11.3
Run the two-way between subjects ANOVA
11.3.1
Estimated Means
11.3.2
Interaction Plot
11.4
Post-hoc tests
11.4.1
Simple Main Effects
Simple Main Effect of Gender
Simple Main Effect of Education Level
11.4.2
Simple Comparisons
11.4.3
Marginal Comparisons
Gender
Education Level
12
Two-Way Within Subjects ANOVA
12.1
Descriptive Statistics
12.2
Assumptions
12.2.1
Normality
Shapiro-Wilk
Histogram
QQ Plot
Detrended QQ Plot
12.2.2
Sphericity
12.3
Run the Two-Way Within Subjects ANOVA
12.3.1
Estimated Means
12.3.2
Interaction Plot
12.4
Post-hoc testing
12.4.1
Simple Main effects
Simple Main Effect of Treatment
Simple Main Effect of Time
12.4.2
Simple comparisons
12.4.3
Main Effects
12.4.4
Marginal Comparisons
Treatment
Time
13
Mixed ANOVA
13.1
Descriptive Statistics
13.2
Assumptions
13.2.1
Normality
Shapiro-Wilk
Histogram
QQ Plot
Detrended QQ Plot
13.2.2
Homogeneity of Covariances
13.2.3
Test of Sphericity
13.3
Run the Mixed ANOVA
13.3.1
Estimated Means
13.3.2
Interaction Plot
13.4
Post-hoc testing
13.4.1
Simple Main effects
Simple Main Effect of Group
Simple Main Effect of Time
13.4.2
Simple comparisons
13.4.3
Main Effects
13.4.4
Marginal Comparisons
Treatment
Time
14
ANCOVA
14.1
Descriptive Statistics
14.2
Assumptions
14.2.1
Linearity
14.2.2
Homogeneity of Regression Slopes
14.3
Run the Model to generate residuals
14.3.1
Normality
14.4
Post-hoc testing
References
Appendix
A
Basics Code
B
Lists and Dataframes Code
C
One-Sample T-test code
D
Independent Samples T-test code
E
Repeated Measures T-test code
F
Correlation and Regression code
G
One-way Between Subjects ANOVA code
H
One-way Within Subjects ANOVA code
Published with bookdown
R Companion for Intermediate Stats
T-Tests
The following chapters will address the different types of t tests performed in this class:
Chapter 5
will address One Sample t-tests
Chapter 6
will address Independent Sample t-tests
Chapter 7
will address Repeated Measures t-tests