Slides for Nick’s STATS 250 Labs - Fall 2020
PDF versions of the slides are available on our Lab Resources page on Canvas.
All materials © 2020 Nicholas J. Seewald
Introduction Video
Welcome to STATS 250 Lab! Please watch this video for details on lab policy and logistics.
Quick Links
Jump to a specific lab by clicking the appropriate link:
[Lab 1: Getting Started with R]
[Lab 2: Basics of Data with R]
[Lab 4: Probability and Scatterplots]
[Lab 5: Plotting and Linear Regression]
[Lab 6: Simulation Basics]
[Lab 7: Simulation-Based Hypothesis Testing]
[Lab 8: Sampling Distributions of Proportions]
[Lab 9: Normal Distribution]
[Lab 10: Confidence Intervals and Hypothesis Tests for Proportions]
[Lab 11: Confidence Intervals and Hypothesis Tests for One Mean]
[Lab 12: Paired Data and Difference of Two Means]
[Lab 13: Linear Regression Inference]
Lab videos are available on Youtube! [Video Playlist]
Lab 1: Getting Started with R
Lab materials for the week of August 31, 2020
Statistical Learning Goals
- Learn how to visualize categorical data in a bar chart
- Learn how to summarize quantitative and categorical data
R Learning Goals
- Learn the difference between R, RStudio, and R Markdown
- Become familiar with the RStudio interface
- Understand key components of an R Markdown document
- Become familiar with R functions and arguments
Slides
Lab 2: Basics of Data with R
Lab materials for the week running Friday 9/4 - Friday 9/11. All labs are asynchronous due to Labor Day.
Statistical Learning Objectives
- Understand the structure of data (observations and variables)
- Think about the scope of a data set: what questions can and cannot be answered with a particular data set?
R Learning Objectives
- Learn how to “assign” information to “objects” in R
- See how R “reads in” a data set from a file
- Be able to identify the names of variables contained in a data set
- Make a frequency table for one or two variables
Slides
Lab 3: See Canvas
Lab 4: Probability and Scatterplots
Lab materials for the week running Friday 9/18 - Friday 9/25.
Statistical Learning Objectives
- Sampling with replacement versus sampling without replacement
- The Law of Large Numbers and expected values
- Scatterplots with linear associations
- The correlation coefficient
R Learning Objectives
- Creating a sequence of integers between two values.
- Learning how to randomly sample from a set, with replacement or without replacement.
- Creating a plot of (x,y) quantitative values.
- Finding the correlation coefficient between two quantitative variables.
Slides
Lab 5: Plotting and Linear Regression
Lab materials for the week running Friday 9/25 - Friday 10/2.
Statistical Learning Objectives
- Interpret a correlation matrix
- Interpret a fitted linear regression model
- Check the fit of the linear regression model using \(R^2\)
- Explore the dangers of extrapolation
R Learning Objectives
- Dive deeper into R plotting
- Create a correlation matrix
- Use R to fit a linear regression model
Slides
Lab 6: Simulation Basics
Lab materials for the week running Friday 10/2 - Friday 10/9
Statistical Learning Objectives
- Explore sample-to-sample variation
- Investigate probability using long-run proportions
R Learning Objectives
- Learn about reproducible randomness by “setting seeds”
- Functions within functions:
table(sample())
- Line graphs in R
Slides
Lab 7: Simulation-Based Hypothesis Testing
Lab materials for the week running Friday 10/9 - Friday 10/16
Statistical Learning Objectives
- Get experience with randomization under an independence model
- Explore hypothesis testing and p-values
R Learning Objectives
- Learn how to perform simulations under an independence model
Slides
Lab 8: Simulation-Based Hypothesis Testing
Lab materials for the week running Friday 10/16 - Friday 10/23
Statistical Learning Objectives
- Discover the central limit theorem for proportions
Slides
Lab 9: Normal Distribution
Lab materials for the week running Friday 10/23 - Friday 10/30
Statistical Learning Objectives
- Understand Z scores and percentiles
- Get experience with the normal distribution
R Learning Objectives
- Learn how to use R to work with the normal distribution
Slides
Lab 10: Confidence Intervals and Hypothesis Tests for Proportions
Lab materials for the week running Friday 10/30 - Friday 11/6.
All labs are asynchronous this week due to the election.
Statistical Learning Objectives
- Understand how confidence intervals are constructed
- Understand what a confidence level means
- Consider the relationship between confidence intervals and hypothesis testing
R Learning Objectives
- Interpret R output providing confidence intervals and hypothesis tests for inference on population proportions.
- Use R as a calculator to compute a confidence interval
Slides
Lab 11: Confidence Intervals and Hypothesis Tests for One Mean
Lab materials for the week running Friday 11/6 - Friday 11/13.
Statistical Learning Objectives
- Get experience making confidence intervals for population means
- Understand hypothesis tests for population means
R Learning Objectives
- Interpret R output providing confidence intervals and hypothesis tests for inference on population means.
Slides
Lab 12: Paired Data and Difference of Two Means
Lab materials for the week running Friday 11/16 - Friday 11/20.
Statistical Learning Objectives
- Continue discussing quantitative data, this week in regards to a paired mean and a difference in two means scenario.
- Understand whether data is considered paired or from two independent samples.
R Learning Objectives
- Create a “difference” variable in a data.frame
- Learn how to use R to perform paired t-tests and t-tests for two independent samples.
Slides
Lab 13: Linear Regression Inference
Lab materials for the week running Monday 11/30 - Friday 12/4.
Statistical Learning Objectives
- Learn about how to make inference for linear regression parameters
- Learn about conditions needed for valid inference in regression
R Learning Objectives
- Learn how to interpret output from
lm()
to make inference in regression
- Learn how to use R to check conditions for valid inference in regression
Slides