Description of the data, data_quiz5
country
continent
lifeExp
life expectancy in year
pop
total population
gdpPercap
GDP per capita in U.S. dollar
Q1 Import data
Hint: The data is posted in Moodle. Look for data_quiz5.csv under the Data Files section.
Q2 Review data
Hint: Use head()
to display the first six rows.
head('myClusterData')
## [1] "myClusterData"
Q3 Visualize data
Hint: Create a scatter plot to examine the relationship between GDP per capita (mapped to y-axis) and life expectancy (mapped to x-axis).
Q4 Build a regression model to predict GDP per capita using life expectancy.
Q5 Is the coefficient of life expectancy statistically significant at 5%?
Q6 Interpret the coefficient of life expectancy.
Hint: Discuss both its sign and magnitude.
Q7 Your friend suggests that the more populous a country, the higher its standard living (GDP per capita) is. Create a new model below by adding an additional predictor to the regression model above to test this hypothesis. Is the new variable statistically significant? What would you say to your friend regarding his/her claim?
Hint: Make your argument using the relevant test results, such as p-value.
Q8 Hide the messages, but display the code and its results on the webpage.
Q9 Display the title and your name correctly at the top of the webpage.
Q10 Use the correct slug.