Linear Regression Pegboard Visualization

Overview

In this assignment, you will physically build a regression plot using dowels, springs, and Styrofoam at the Wakerspace. Then you will “extract the data” (i.e., make a grid and record your x and y coordinates), fit a model in R, and visualize it with ggplot2.

Deliverables

Each group (or individual if you decided to work individually) will turn in three things:

  1. The physical Model
  2. gglot output
  3. one paragraph about what you learned

WakerSpace Safety Training

Due: Before April 3rd

Before you can use the WakerSpace equipment, you must complete the required safety training. Visit the WakerSpace and complete the in-person safety training session.

Warning

You will not be permitted to pick up materials without completing safety training first.

Plot Random Data

After you have your Styrofoam “plot” at least 6 (and up to 10) data points by pushing the dowels into the Styrofoam. There may be some trial and error here, you want them to be sufficiently far apart (and with some trend!) to be interesting, but not so far apart that it isn’t possible to reach any of the available springs from the “regression” line.

Add Springs

I have sourced several different types of springs (it turns out this was harder than I expected!!) for this project. You will need one spring per data point and are welcome to try any of the ones available at the Wakerspace. There will definitely be some trial and error here – I have purchased some needle nose pliers that may help you attach your springs to the dowels, stretch the springs if they aren’t “springy” enough, etc.

The Springs then need to connect to the “regression line” dowel.

Note

Remember!! This is supposed to be a fun project to get us off the white board / computer and working with our hands on the concepts we’ve covered in class, if you find yourself getting frustrated, take a step back for a minute!

Calculate the “true” regression line to compare

Pull your x y coordinates from your model (i.e., overlay a grid and extract where the dowels fall on the x-axis and y-axis). Calculate \(\hat\beta\) using these x and y values. How does the least squares solution to \(\hat\beta_0\) and \(\hat\beta_1\) compare to what you see in your model?

Plot with ggplot2

Create a scatter plot of the data with the fitted regression line. Compare this image to your model.

Write up

Write up a short paragraph of what you learned from this experience. You will turn this in along with your model on Monday, April 13.

Notes

A few things to remember about this:

  1. Again, each group (or individual if you decided to work individually) will turn in three things (1) the physical Model, (2) the gglot output, (3) one paragraph about what you learned
  2. You can work with other groups to troubleshoot best ways to make this work, if you would like to
  3. Again, this is meant to be fun!! Please decorate your models and have fun trying to create a “physical” representation of ordinary least squares
  4. If you would like to try to incorporate other tools or materials please feel free!! I welcome your creativity!