Course Notes
Course:
About the Author
1
Introduction
1.1
A focus on workflow
1.2
R works with plug-ins
1.3
Software Choice
1.3.1
Mac
1.3.2
PC
1.4
Run RStudio not R
1.5
RStudio configuration, First run only
1.6
Begin with an RStudio Project
1.7
Exploring the R Studio Interface
1.7.1
Console panel
1.7.2
Script Panel
1.8
Writing your first script
1.8.1
Create the script file
1.8.2
Add a comment to your script
1.8.3
Background about the tidyverse
1.8.4
Add library(tidyverse) to your script
1.8.5
Activate tidyverse auto-complete for your script
1.9
Loading your data
1.9.1
Use read_csv (not read.csv) to open files.
1.10
Checking out your data
1.10.1
view(): See a spreadsheet view of your data
1.10.2
print(): See you data in the Console
1.10.3
head(): Check out the first few rows of data
1.10.4
tail(): Check out the last few rows of data
1.10.5
summary(): Quick summaries
1.11
Run
vs.
Source with Echo
vs.
Source
1.11.1
Run select text
1.11.2
Source (without Echo)
1.11.3
Source with Echo
1.12
Trying Source with Echo
1.13
A few key points about
1.13.1
Lists
1.14
Revisiting read_csv()
1.15
That’s it!
2
Handling Data with the Tidyverse
2.1
Required
2.2
Objective
2.3
Using the Console
2.4
Tidyverse help with the Introverse
2.5
Basic tidyverse commands
2.5.1
select()
2.5.2
summarise()
2.5.3
filter()
2.5.4
group_by()
2.5.5
mutate()
2.6
Advanced tidyverse commands
2.6.1
select()
2.6.2
summarise()
2.6.3
mutate()
2.7
Using help
2.8
Base R vs tidyverse
2.8.1
Tibbles vs. data frames
2.8.2
read.csv() and data frames
2.8.3
read_csv() and tibbles
3
Graphing
3.1
Required
3.2
Data
3.3
Graph basics
3.4
Graphing efficiently
3.5
Aesthetics
3.5.1
Fill color
3.5.2
Overriding aes()
3.6
APA style
3.7
Axes
3.7.1
Range
3.7.2
Ticks
3.7.3
Labels
3.8
Axis values
3.8.1
Text
3.8.2
Angle
3.8.3
Alignment
3.8.4
Order
3.8.5
Legend order
3.9
Custom colours
3.9.1
R palette
3.9.2
Hex colours
3.10
Emoji
3.11
Accessible Colors
3.11.1
RColorBrewer
3.11.2
Avoid color
3.12
Saving
3.12.1
MAC
3.12.2
PC or MAC
4
Populations
4.1
Notation
4.2
Population vs samples
4.3
A small population
4.3.1
Mean (
\(\mu\)
)
4.3.2
Variance (
\(\sigma^2\)
)
4.3.3
Standard Deviation (
\(\sigma\)
)
4.4
Visualizing populations
4.5
Comparisons: Same
\(\sigma\)
4.5.1
Standardized units
4.5.2
Cohen’s
\(d\)
units
4.5.3
Cohen’s
\(d\)
advantages
4.5.4
Cohen’s
\(d\)
caveats
4.6
Comparisons: Different
\(\sigma\)
4.7
Comparisons: Repeated Measures
4.8
Comparison Benchmarks
4.9
Population relations
4.10
Relation benchmarks
4.11
Key points
4.12
Minor Points
4.13
Self Assessment
5
Sampling Accuracy
5.1
Overview
5.2
Data for the chapter
5.3
Notation
5.4
Estimating
\(\mu\)
5.4.1
Assessing bias
5.5
Estimating
\(\sigma^2\)
5.5.1
Assessing bias
5.6
Estimating
\(\sigma\)
5.7
Estimating
\(\delta\)
5.7.1
Pooled standard deviation
5.7.2
Calculating
\(d\)
5.7.3
Assessing bias
5.7.4
Illustrating variability
5.8
Estimating
\(\rho\)
5.8.1
Assessing bias
5.9
Overview
5.10
Meta-analysis
5.11
A joke
5.12
Key Points
6
Sampling Precision
6.1
Overview
6.2
Population / Individuals
6.3
Sampling distribution
6.4
Precision indices
6.5
A short cut
6.6
Estimates of precision
6.6.1
A worked example
6.7
Bias of precision estimates
6.8
Where are we?
6.9
Precision for means: Causes
6.10
Precision for
\(d\)
-values: Causes
6.10.1
Sample size
6.10.2
Population effect size (
\(\delta\)
)
6.11
Precision for sample correlations (
\(r\)
): Causes
6.11.1
Sample size
6.11.2
Population effect size (
\(\rho\)
)
7
An Emphasis on Workflow
7.1
Required Packages
7.2
Objective
7.3
Begin with the end in mind
7.3.1
Structuring data: Obtaining tidy data
7.4
Data collection considerations
7.4.1
File naming conventions
7.4.2
Data column naming conventions
7.4.3
Likert-type items
7.5
Example: Single Occassion Survey
7.5.1
Creating factors
7.5.2
Factor screening
7.5.3
Numeric screening
7.5.4
Scale scores
8
Regression and correlation
8.1
Population example
8.1.1
No predictor
8.1.2
Weak relation
8.1.3
Strong relation
8.2
Consider a sample
8.2.1
Regression
8.2.2
Correlation
8.2.3
Graphing
8.3
Comparing correlations
8.3.1
p-values
8.3.2
Within a data set
8.3.3
Between data sets
9
Multiple regression
9.1
Overview
9.2
Example
9.3
Load the data
9.4
Bivariate relations
9.5
Single best predictor
9.6
Multiple regression
9.7
b
-weights
9.8
\(R^2\)
9.8.1
Method 1: Ratio Approach
9.8.2
Method 2: Correlation Approach
9.8.3
\(R^2\)
in practice
9.9
Semi-partial (
\(sr\)
)
9.9.1
\(sr^2\)
in theory
9.9.2
\(sr^2\)
in practice
9.9.3
Blocks regression
9.10
Beta-weights
9.10.1
In practice
9.10.2
Old school
9.11
Graphing
References
Published with bookdown
Welcome!
Welcome!
David J. Stanley
2023-09-23
Course:
These notes are a resource for students in my PSYC 3290 class.