R Programming

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

R Programming

Post by answerhappygod »

R Programming
R Programming 1
R Programming 1 (154.01 KiB) Viewed 77 times
Question 3. [20 points] Consider the data set Diamonds from the Stat2Data library: library(ggplot2) library (Stat2Data) data("Diamonds") The data set contains information on the price (in dollars) and carat (weight of diamond) for a sample of 351 diamonds. (a) Make a scatter plot with TotalPrice on the y-axis, and Carat on the x-axis. (b) Use the Im() function to fit the quadratic regression model y = Bo + B1x + 32x2 + €, where y = TotalPrice and x = Carat. Use summary() to print the results, and interpret the RP. (c) Use the fitted regression model to make a prediction for TotalPrice when Carat = 1.25. (d) Use ggplot2 to add the fitted quadratic regression curve to the scatter plot of TotalPrice versus Carat. (e) Make a plot of the residuals versus fitted values for the quadratic regression model fit in (b). Based on this plot do there appear to be any violations of the conditions for regression model- ing? If so, do you think that model is still useful for making predictions?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply