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 Add fun no-universal(r): not(r["has-univ-healthcare"]) end
at the bottom of the Definitions Area.
Read the function definition carefully. What do you think it does?
2 Click "Run" and evaluate no-universal(albania)
in the Interactions Area. What does Pyret return?
3 What does that mean?
4 Add countries-wo-univ = filter(countries-transformed, no-universal)
to the Definitions Area and click "Run".
What does evaluating countries-wo-univ
in the Interactions Area produce?
5 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.
6 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 S 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 |
f(x) = slopex + y-intercept |
f(x) = slopex + y-intercept |
Logarithmic Model |
f(x) = log coefficient log10(x) + y-intercept |
f(x) = log coefficient log10(x) + y-intercept |
S |
years |
years |
What does each model predict the increase in |
||
predicted increase |
years |
years |
7 Was the relationship stronger for countries-w-univ
or countries-wo-univ
?
8 For which table is pc-gdp
expected to have a bigger impact on median-lifespan
?
9 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.