Week 11: Statistics in R
Lectures
For a project, follow 11.1 from the first look through the model. Use 11.2 when the question is a comparison of groups, a proportion, or a table of counts.
Labs
- Lab 11: Tests and Models(PDF)
- Lab 11 solutions (password)
Additional readings
- Tidy Modeling with R: A review of R modeling basics
- broom: Convert model output to tidy tibbles
- R for Data Science: Exploratory data analysis
Videos
- Student's t-test (Bozeman Science)
- Hypothesis testing: z tests and t tests, one- and two-tailed (Organic Chemistry Tutor)
- ANOVA using R (R Programming 101)
- ANOVA in R: aov() (Dr. Kidd)
- Chi-square test (Organic Chemistry Tutor)
- Linear regression in R, step by step (StatQuest)
- What is a residual plot? (Zach's Math Zone)
- Quantile-quantile plots, clearly explained (StatQuest)
Discussion
- You open a new table for a project. What do you do before you call
lm()? wtanddispmove together. How do you decide which one to keep, and what doesanova()on the two nested fits add?wtandhplive on different scales. What does standardizing change, and what stays the same?- The scatter of
mpgagainsthpbends. When is a straight line enough, and when do you fit a spline?