For this page, you’ll need to have the Covid Spread Starter File open on your computer. If you haven’t already, select Save a Copy from the "File" menu to make a copy of the file that’s just for you.
This starter file defines a table just for MA data, called MA-table
: MA-table = filter(covid-table, is-MA)
1 Make a scatter plot from |
|
As we’ve seen, it’s easy to fit a linear model to any dataset in Pyret, so let’s start by testing how well a linear function could model this data.
2 Use lr-plot
to obtain the best-possible linear model for the MA Covid dataset, and write it below:
y = S =
Note: Pyret uses e
for scientific notation. For example: 2.46e3 = 2.46 × 103 = 2460
3 The optimized linear model for this dataset predicts an increase / decrease of about slope y-variable per x-variable.
The error in the model is described by an S-value of about Sunits, which is a poor, ok, good fit considering that y-variable in this dataset range from lowest y-value to highest y-value.
4 Change the definition of the linear
function in the Covid Spread Starter File to match the model produced by lr-plot
and "Save".
5 Do you think a linear function is a good model for this dataset? Why or why not?
★ What do you think the code that defines MA-table
is actually doing?
These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, 1738598, 2031479, and 1501927). Bootstrap by the Bootstrap Community is licensed under a Creative Commons 4.0 Unported License. This license does not grant permission to run training or professional development. Offering training or professional development with materials substantially derived from Bootstrap must be approved in writing by a Bootstrap Director. Permissions beyond the scope of this license, such as to run training, may be available by contacting contact@BootstrapWorld.org.