Question

In: Statistics and Probability

For the mtcars dataset (in R), comment on how Rear axle ratio is associated with Displacement...

For the mtcars dataset (in R), comment on how Rear axle ratio is associated with Displacement (cu.in.) and Miles/(US) gallon using the following steps:

  1. Draw appropriate scatterplot(s) [Show your code in “R Code” section. Leave “Answer” section blank. Justify your choice of charts in a few sentences in “Comments” section. No screenshots of the charts are required.]
  1. Determine correlation coefficient(s) [Show your code in “R Code” section. Show the answer in “Answer” section. Leave “Comments” section blank.]

  1. Calculate and plot appropriate regression lines [Show your code in “R Code” section. Leave “R Code” and “Comments” section blank.]
  1. Comment on how the variables are associated with each other [Leave “R Code” and “Answer” section blank. Include the phrase “associated” or “not associated” along with a justification in a few sentences in “Comments” section.]

Solutions

Expert Solution

ANSWER::

R Code:

#data
Mtcars = mtcars
View(mtcars)

#Scatterplot
plot(Mtcars$mpg,Mtcars$disp,main = "Scatter plot between mpg and disp")

#correlation coefficient between mpg and disp
cor(Mtcars$mpg,Mtcars$disp)
#calculate regression coefficient using lm function
lm(Mtcars$disp~Mtcars$mpg)

#Fitted regression line
abline(lm(Mtcars$disp~Mtcars$mpg))

(a)

(b)

Correlation coefficient = -0.8475514


(c)

fitted regression line:

(d)

Using the above-fitted regression line we conclude that mpg is negatively associated with displacement.

Similarly, we can do for the mpg and hp

R code:


# between mpg and hp

#Scatterplot
plot(Mtcars$mpg,Mtcars$hp,main = "Scatter plot between mpg and disp")

#correlation coefficient between mpg and disp
cor(Mtcars$mpg,Mtcars$hp)

#calculate regression coefficient using lm function
lm(Mtcars$hp~Mtcars$mpg)

#Fitted regression line
abline(lm(Mtcars$hp~Mtcars$mpg))

(a)

(b)

correlation coefficient = -0.7761684

(c)


(d)

Using the above-fitted regression line we conclude that mpg is negatively associated with Gross horsepower.

NOTE:: I HOPE THIS ANSWER IS HELPFULL TO YOU......**PLEASE SUPPORT ME WITH YOUR RATING......

**PLEASE GIVE ME "LIKE".....ITS VERY IMPORTANT  FOR,ME......PLEASE SUPPORT ME .......THANK YOU


Related Solutions

Examine classification using logistic regression. In R console, type mtcars. The dataset mtcars is a generic...
Examine classification using logistic regression. In R console, type mtcars. The dataset mtcars is a generic dataset in R. This dataset comprises of fuel consumption and 10 aspects of automobile design and performance for 32 automobiles. Using only the variables am (0 = automatic, 1 = manual) and mpg, your task is to fit a logistic regression model. Complete the following steps using R. Create a scatter plot of am vs. mpg. Describe the relationship and explain why a simple...
R has many build-in dataset. The data mtcars is one of them. The following R code...
R has many build-in dataset. The data mtcars is one of them. The following R code read-in data and save the data to input.                   input <- mtcars[,c("am","cyl","hp","wt")]              Write a few line of R code to conduct a regression analysis with am as the response variable, and              cyl, hp, wt as explanation variables.
R has a number of datasets built in. One such dataset is called mtcars. This data...
R has a number of datasets built in. One such dataset is called mtcars. This data set contains fuel consumption and 10 aspects of automobile design and performance for 32 automobiles (1973-74 models) as reported in a 1974 issue of Motor Trend Magazine. We do not have to read in these built-in datasets. We can just attach the variables by using the code attach(mtcars) We can just type in mtcars and see the entire dataset. We can see the variable...
Using the Motor Trend Car Road Tests dataset mtcars, in faraway R package, fit a model...
Using the Motor Trend Car Road Tests dataset mtcars, in faraway R package, fit a model with mpg: Miles/(US) gallon as the response and the other variables as predictors. (a) Which variables are statistically significant at the 5% level? For each and every test provide the null and alternative hypotheses, critical region (or rejection region), test statistics and your conclusions. (30) (b) What interpretation should be given to the coefficient for vs: Engine? (3) (c) Compute 90 and 95% confidence...
Instructions tell you how to get the data in R R has built in dataset called...
Instructions tell you how to get the data in R R has built in dataset called Iris. This famous (Fisher's or Anderson's) iris data set gives the measurements in centimeters of the variables sepal length and width and petal length and width, respectively, for 50 flowers from each of 3 species of iris. The species are Iris setosa, versicolor, and virginica. We are interested in estimating the length of Petal (Y) using the length of Sepal (X). First, load the...
how to find the first, second, third quantile of a column in a dataset with R?...
how to find the first, second, third quantile of a column in a dataset with R? the dataset is like this: columns values a. 1. 2. 3. 5. 6. 7. 4. 7. 8. ......... b 5. 6. 7. 3. 8. 0. 4. 7. 4. 7. ......... c    1. 2. 3. 5. 6. 7. 4. 7. 8. ......... d 6. 3. 1. 0. 8. 3. 6. 6. 3.........
Comment on 2 financial ratios and discuss how the ratio is a "double edged sword" and...
Comment on 2 financial ratios and discuss how the ratio is a "double edged sword" and can be possibly too good.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT