For this page, you’ll need the Countries of the World 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.
1 Read the function definition carefully: fun no-universal(r): not(r["has-univ-healthcare"]) end
What do you think this function does?
2 Add fun no-universal(r): not(r["has-univ-healthcare"]) end
at the bottom of the Definitions Area.
Click "Run" and evaluate no-universal(albania)
in the Interactions Area.
What does Pyret return?
3 Add countries-wo-univ = filter(countries2, no-universal)
to the bottom of the Definitions Area, then click "Run".
What does evaluating countries-wo-univ
in the Interactions Area produce?
4 Using the two definitions you just added as models:
-
Define a new function called
yes-universal
, which returns the value in thehas-univ-healthcare
column. -
Define a new table called
countries-w-univ
, which shows all the countries with universal healthcare. -
Click "Run" to load these new definitions once you have them both typed into the Definitions Area.
5 Fill in the table below by:
-
Building an
lr-plot
for each of these tables with the transformed-columnlog-pc-gdp
. -
Using what you learn from
lr-plot
to write logarithmic models for each table. -
Using
fit-model
to find 𝑅2 for each of your logarithmic models and their corresponding un-transformedcountries-w-univ
andcountries-wo-univ
tables.
With Universal Healthcare | Without Universal Healthcare | |
---|---|---|
Linear Model |
𝑓(𝑥) = slopex + y-intercept |
𝑓(𝑥) = slopex + y-intercept |
Logarithmic Model |
𝑓(𝑥) = log coefficient log10(𝑥) + y-intercept |
𝑓(𝑥) = log coefficient log10(𝑥) + y-intercept |
𝑅2 |
|
|
6 Was the relationship stronger for countries-w-univ
or countries-wo-univ
?
7 In countries-w-univ
, what is the expected increase in median-lifespan
for each 10x increase in pc-gdp
?
8 In countries-wo-univ
, what’s the expected increase in median-lifespan
for each 10x increase in pc-gdp
?
9 For which table does an increase in pc-gdp
have a bigger expected impact on median-lifespan
?
10 Does the strength of the relationship determine how large of an impact pc-gdp
has on median-lifespan
?
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.