Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Prediction of diamond price set.seed( 1 ) data (diamonds)diamonds size= 5000 ) Use thesummary()function to obtain summaries of each variable in the diamonds dataset.

1. Prediction of diamond price

set.seed(1)data(diamonds)diamonds size=5000)
  1. Use thesummary()function to obtain summaries of each variable in the diamonds dataset. How many categorical variables are there? How many quantitative variables? Are there any missing values?
  2. Use thextabs()function to obtain cross-tabulations of all possible pairs of categorical variables. How many diamonds are of the best cut (Ideal) and clarity (IF)?
  3. Excluding price (our response variable), which three quantitative variables are most highly correlated with carat (weight of the diamond)?
  4. Remove x, y and z from the dataset and fit a model with price as the response variable and all main effects and possible interactions as explanatory variables. Call your fitted modelfit.full.
  5. Starting fromfit.full, and using the null model as the smallest model, use stepwise selection to select a model, using the BIC criterion. (You don't need to specify thescopeof the models -step()will search fromfit.fullto the null model by default.) What main effects and what interactions are included in the final model?
  6. For eachcategoricalexplanatory variable that appears in an interaction with carat in the model selected by stepwise selection, produce a scatterplot of price versus carat with the categorical interaction variable as color. For example, if there is a carat:clarity interaction, do

image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Nonlinear Systems And Their Remarkable Mathematical Structures Volume 3, Contributions From China

Authors: Norbert Euler, Da jun Zhang

1st Edition

1000423301, 9781000423303

More Books

Students also viewed these Mathematics questions

Question

Describe several strategies for relieving stress.

Answered: 1 week ago

Question

What is Larmors formula? Explain with a suitable example.

Answered: 1 week ago

Question

What are the ethical scrutiny requirements of your centre?

Answered: 1 week ago