Question
Load the UN11 data set from the alr4 package. The data set includes 237 observations related to national health, welfare, and education statistics for 210
Load the UN11 data set from the alr4 package. The data set includes 237 observations related to national health, welfare, and education statistics for 210 places, mostly UN members, but also other areas like Hong Kong that are not independent countries. More details can be found by running ?alr4::UN11 in the R Console. The variables in the data set include:
region: region of the world group: a factor with levels oecd for countries that are members of the OECD, the Organization for Economic Co-operation and Development, as of May 2012, africa for countries on the African continent, and other for all other countries. No OECD countries are located in Africa. fertility: number of children per woman ppgdp: per capita gross domestic product in US dollars lifeExpF: female life expectancy, in years pctUrban: percent urban
library(effects)
## Loading required package: carData ## lattice theme set by effectsTheme() ## See ?effectsTheme for details. data(UN11, package = "alr4") We will consider the relationship between the response log(fertility) and several of the other variables in the data set.
# Problem 1
Fit a linear model regressing `log(fertility)` on `pctUrban`. Print the estimated coefficients of the model.
# Problem 2
What is the equation for the fitted model?
# Problem 3 Interpret the estimated coefficient for `pctUrban` in a straightforward sentence in the context of the problem.
# Problem 4
Use the fitted model to construct an effect plot for `pctUrban` on `fertility` (on the original scale for `fertility`). Note you will need to modify the `axes` argument of the `plot` function. The **effects** package has a vignette that may be helpful, it may be accessed by running `vignette("predictor-effects-gallery", package = "effects")` in the R console.
# Problem 5
Interpret the effects plot from the previous problem.
# Problem 6
Fit the linear model regressing `log(fertility)` on both `log(ppgdp)` and `lifeExpF`. Print the results to the R Console. Use this fitted model to also answer Problems 7-10.
# Problem 7
What is the equation for the fitted model from the previous problem?
# Problem 8
Mathematically, if we increase `ppgdp` by 25%, what is the expected decrease in fertility? (You don't need to interpret this, just compute it).
# Problem 9
Interpret the estimated coefficient for `ppgdp` in a straightforward sentence in the context of the problem when `ppgdp` increases by 25%.
# Problem 10
Construct an effect plot of `ppgdp` on `fertility` (both on their original scale) using the fitted model from Problem 6.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started