Question: 4. The data set Leinhardt in the R package car has data on per capita income and infant mortality rate from several countries. Use the
4. The data set Leinhardt in the R package car has data on per capita income and infant mortality rate from several countries. Use the R commands install.packages(”car”) to install the package, the command library(car) to make the package available to the current R session, and the command x=Leinhardt$
income; y=Leinhardt$infant to set the income values and mortality rates in the R objects x and y, respectively.
(a) Construct the (x, y) and (log(x), log(y)) scatterplots.
Which scatterplot suggests a linear relationship?
[Note: Cases with missing values are omitted when plotting.]
(b) Fit the simple linear regression model to the set of variables whose scatterplot suggests a linear relationship and give the estimated regression line.
(c) Use the estimated regression line from part
(b) to predict the infant mortality rate of a country with per capita income of 1400.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
