Open your copy of the Countries of the World Starter File and click "Run".
Part 1
1 Find the definition of g(r)
. What does this function do?
2 Find the Contract for build-column
on the Contracts Page.
What is its Range? What is its Domain?
3 At the end of the program, you’ll find this code:
countries-transformed = build-column(countries-table, "log(pc-gdp)", g)
What do you think it does?
4 Click "Run", and evaluate countries-transformed
in the Interactions Area on the right to test it out!
a. What did you get back?
b. What is different about this Table?
c. Where did the column on the right come from?
d. What does that line of code at the end of the program do?
5 Use this new table to make an lr-plot
comparing log(pc-gdp)
and median-lifespan
with country
as the label.
6 Record the regression line here: ๐ฆ = slope ๐ฅ + vertical shift ๐ 2:
Part 2
7 Use the values produced by lr-plot
to complete the model: ๐o๐๐๐๐๐กโ๐๐๐(๐ฅ) = log coefficient ๐o๐10(๐ฅ) + vertical shift
8 Let’s interpret this model:
A 10x increase in per-capita-GDP
is associated with median-lifespan
increasing by .
9 Rewrite your model as a pyret definition: fun logarithmic(x):
end
10 Add the definition to your starter file and click "Run" to load it.
11 Use fit-model
to calculate the value of ๐
2:
12 Let’s interpert this ๐ 2 value:
Roughly percent of the variation in is explained by the variation in .
โ Are there other relationships you can think of, which might be logarithmic?
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.