Question

1. The data set UN11 in the alr4 package contains several variables, including ppgdp, per capita gross domestic product in US dollars, and fertility, number of children per woman, from the year 2009-2011. The data are for 199 localities, and we will study the regression of ppgdp on fertility. (a) Draw the scatterplot of ppgdp against fertility and describe the relationship between these two variables. Is the trend linear? (b) Replace both variables by their natural logarithms and draw another scatterplot. Does the simple linear regression model seem plausible for a summary of this graph? (c) Without using the R function Im), find the least-squares estimates regressing log(ppgdp) on log(fertility) and add the line in the plot in (a).

0 0
Add a comment Improve this question Transcribed image text
Answer #1

a) R-code:

Console Terminal > data(UN11) > data (UN11) > fertility-UN11Sfertility > plot (fertility, ppgdp,main- scatter Plot) yonx-1m(ppgdp fertility) >abline (yonx) summary(yonx) Call 1m(formula-ppgdpfertility) Residuals Min 1Q Median 3Q Max -19317-10197 -4261 4237 85562 Coefficients: (Intercept) 29711.6 fertility Estimate std. Error t value Pr(ltI) 2697.7 11.014 < 2e-16 879.4 -6.8777.9e-11 -6047.6 signif. codes 0.001 0.01 * 0.05. 0.11 Residual standard error: 16580 on 197 degrees of freedom Multiple R-squared 0.1936, F-statistic: 47.29 on 1 and 197 DF, p-value: 7.903e-11 Adjusted R-squared: 0.1895

Scatter Plot 4 fertility

b)

> fertility-log (UN11Sfertility) > ppgdp-1 og (UNL1Sppgdp) yonx-1m(ppgdp fertility) > plot (fertility,ppgdp,main-Scatter Plo

c)

Scatter Plot 0.5 1.5 2.0 fertility

Add a comment
Know the answer?
Add Answer to:
1. The data set UN11 in the alr4 package contains several variables, including ppgdp, per capita...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • R programming question. Please use #comments too ! 1. The data set UN11 in the alr4...

    R programming question. Please use #comments too ! 1. The data set UN11 in the alr4 package contains several variables, including ppgdp, per capita gross domestic product in US dollars, and fertility, number of children per woman, from the year 2009-2011. The data are for 199 localities, and we will study the regression of ppgdp on fertility (a) Draw the scatterplot of ppgdp against fertility and describe the relationship between these two variables. Is the trend linear? nD the simple...

  • 2. R programming 2·The data set prostate in the faraway package is froma study on 97...

    2. R programming 2·The data set prostate in the faraway package is froma study on 97 men with prostate cancer who were due to receive a radical prostatectomy We are interest is in predicting lpsa (log prostate specific antigen) with Icavol (log cancer volume). (a) Draw a scatterplot -does a simple linear regression model seem reasonable? (b) Without using the R function Im), compute the values T,Y, Sxx, Syy and Sxy. Com- pute the ordinary least squares estimates of the...

  • 2. The data set prostate in the faraway package is from a study on 97 men...

    2. The data set prostate in the faraway package is from a study on 97 men with prostate cancer who were due to receive a radical prostatectomy. We are interest is in predicting lpsa (log prostate specific antigen) with lcavol (log cancer volume). (a) Draw a scatterplot - does a simple linear regression model seem reasonable? (b) Without using the R function Im(0, compute the values , Y,Sxx, Syy and Sxy. Com pute the ordinary least squares estimates of the...

  • Exercise 1. For this exercise use the bdims data set from the openintro package. Type ?bdims to r...

    Exercise 1. For this exercise use the bdims data set from the openintro package. Type ?bdims to read about this data set in the help menu. Of interest are the variables hgt (height in centimeters), wgt (weight in kilograms), and sex (dummy variable with 1-male, 0-female). Since ggplotO requires that a categorical variable be coded as a factor type in R, run the following code: library (openintro) bdíms$sex2 <-factor (bdins$sex, levels-c (0,1), labels=c('F', 'M')) (a) Use ggplot2 to make a...

  • Problem 4: Variables that may affect Grades The data set contains a random sample of STAT 250 Final Exam Scores out of 80 points. For each individual sampled, the time (in hours per week) that the stu...

    Problem 4: Variables that may affect Grades The data set contains a random sample of STAT 250 Final Exam Scores out of 80 points. For each individual sampled, the time (in hours per week) that the student spent participating in a GMU club or sport and working for pay outside of GMU was recorded. Values of 0 indicate the students either does not participate in a club or sport or does not work a job for pay. The goal of...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT