Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In what follows we will use the Cars93 dataset in the MASS package. Install the MASS package using the install.packages command (in the console only).

image text in transcribed
In what follows we will use the Cars93 dataset in the MASS package. Install the MASS package using the install.packages command (in the console only). Then, load the MASS library, View the Cars93 dataset, and pull up the help on it so you can see variable explanations. 1. Use a *which* command to subset only Dodge and Ford cars in this dataset. That is, create a smaller dataframe with the same columns, but the only Manufacturers represented are Dodge and Ford. a. Show the head of the resulting dataframe so that I can see your computation worked. " {r} b. How many rows are in this dataframe? " {r} "c. What is the average price for Dodge cars? What is the average price for Ford? \{r\} d. Use simple R commands to determine which how many cars have MPG.city over 20mpg. Can you determine which models this corresponds to? {r} a. Use base R to create a scatterplot of the variables Weight vs. Turn.circle. Does there appear to be a linear correlation between the variables? If so, what is it and what does it mean? "{r} "b. Find the least squares line of regression between the two variables, and superimpose it on the scatterplot. " {r} c. Use the line for prediction. If a car weighs 3000 pounds, what is the predicted Turn.Circle? How confident are you in this answer? {r} d. Get basic numeric summaries of the variables Turn.circle and Rear.seat.room (look up what these mean). That is, find the mean and 5 number summary of these variables. "'e. You'll have noticed that the NA's can cause trouble. Create a new dataframe called cars.cleaned, that has all of the rows containing NA removed. Compared number of rows to old and new dataframes so I can see it worked. {r}

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

More Books

Students also viewed these Databases questions