Question

In: Statistics and Probability

We will use a data set in the “fpp” package for this question. You need to undertake all initial logistics as shown in class to do this problem.

 

We will use a data set in the “fpp” package for this question. You need to undertake all initial logistics as shown in class to do this problem. (i. e install FPP package. Then call it to script file using library command)

Data set = “fuel” : Fuel economy data on 2009 vehicles in the US.

 

  1. Obtain the scatter plot between “Carbon” and “Highway” variables. Name x-axis as “Highway” and y-axis as “Carbon”.
  1. Fit the least square regression model with y-Carbon and x-Highway. Show the regression output.
  1. Obtain the estimated regression line on the previously obtained scatter plot.
  1. Obtain the residuals and just provide the residual plot.

 

Solutions

Expert Solution

R programme:

install.packages("fpp")
library(fpp)
df <- data.frame(fuel)


# a) Scatter plot
plot(df$Carbon,df$Highway, col= "blue")

# b) regression for Y-carbon nd X-Highway
reg1 <- lm(df$Carbon~df$Highway)
summary(reg1) #Summary of regression line

# c) Scatterplot
plot(df$Highway,df$Carbon)
#Regression line in scatter plot
abline(lm(df$Carbon~df$Highway), col= "red")

# d) Residual plots
par(mfrow = c(2, 2)) # Split the plotting panel into a 2 x 2 grid
plot(reg1) # Plot the model information

A) Scatter plot distribution of X and Y variables data. Plot representing that, Highway increases and carbon emission decreases.

b)

The regression line is: Y= 15.143511-0.258675*Highway

The test significant and P-value is < 0.05 with an accuracy of the model 0.8589.

c) Regression line in Scatter plot:

d) Residual plot: Residuals should not follow any trend.


Related Solutions

Please use R to do it. Using the SATGPA data set in Stat2Data package. Test by...
Please use R to do it. Using the SATGPA data set in Stat2Data package. Test by using α= .05 Question: Test if the proportion of MathSAT greater than VerbalSAT is 0.60 > library(Stat2Data) > data("SATGPA") > data(SATGPA) > SATGPA
Question: the economic impact of another Covid-19 relief package in the USA. Do we need it?...
Question: the economic impact of another Covid-19 relief package in the USA. Do we need it? How can it stimulate the economy? Does it will help stabilize the economy or it bring debt to the country? answers base on articles " Is $1 Trillion Enough for a New Economic Relief Package?"
Use R studio to do this problem. This problem uses the wblake data set in the...
Use R studio to do this problem. This problem uses the wblake data set in the alr4 package. This data set includes samples of small mouth bass collected in West Bearskin Lake, Minnesota, in 1991. Interest is in predicting length with age. Finish this problem without using Im() (a) Compute the regression of length on age, and report the estimates, their standard errors, the value of the coefficient of determination, and the estimate of variance. Write a sentence or two...
Question: the economic impact of another Covid-19 relief package. Do we need it? How can it...
Question: the economic impact of another Covid-19 relief package. Do we need it? How can it stimulate the economy? ANSWER WILL BE BASE ON ARTICLES "Is $1 Trillion Enough for a New Economic Relief Package?" Negotiations between the White House and congressional Democrats over an economic relief package have stalled. White House Chief of Staff Mark Meadows has insisted that the package cost no more than $1 trillion,[1] roughly the cost of the Senate Republican plan, while Democratic leaders have...
(We are using the same data set we used in Question 2) You are the manager...
(We are using the same data set we used in Question 2) You are the manager of the supermarket on the ground floor of Holmes Building. You are wondering if there is a relation between the number of students attending class at Holmes Institute each day, and the amount of chocolate bars sold. That is, do you sell more chocolate bars when there are a lot of Holmes students around, and less when Holmes is quiet? If there is a...
(We are using the same data set we used in Question 2) You are the manager...
(We are using the same data set we used in Question 2) You are the manager of the supermarket on the ground floor of Holmes Building. You are wondering if there is a relation between the number of students attending class at Holmes Institute each day, and the amount of chocolate bars sold. That is, do you sell more chocolate bars when there are a lot of Holmes students around, and less when Holmes is quiet? If there is a...
QUESTION 1) What do we need for translating the probability of categorical outcome to class membership?...
QUESTION 1) What do we need for translating the probability of categorical outcome to class membership? Group of answer choices: a) The logit. b) Hyperparameters. c) The odds ratio. d) A cutoff value. QUESTION 2) Which of the following is true regarding profiling and classification using logistic regression? A) The goal of profiling is to identify the significant predictors that help differentiate between class 1 and class 0. B) The goal of classification is predicting which class an observation would...
Use RStudio. The carsafety data set in the UsingR package has records of the number of...
Use RStudio. The carsafety data set in the UsingR package has records of the number of passenger deaths in the “Other.deaths” column and the type of vehicle in the type column. Determine which type of vehicle is the deadliest for passengers by looking at difference in variance between groups.
This problem uses the data set Heights from the alr4 package, which contains the heights of...
This problem uses the data set Heights from the alr4 package, which contains the heights of n = 1375 pairs of mothers (mheight) and daughters (dheight) in inches. (Solve this problem in r) (a) Compute the regression of dheight on mheight, and report the estimates, their standard errors, the value of the coefficient of determination, and the estimate of variance. Write a sentence or two that summarizes the results of these computa- tions. (b) Obtain a 99% confidence interval for...
You first need to compute the demand function associated with the data set and use that...
You first need to compute the demand function associated with the data set and use that demand function to compute the optimal price for the product. You can use 20% of the average price as the cost of the product. please show excel work P D 1 301 2 106 3 58 4 38 5 27 6 20 7 18 8 14 9 13 10 10 11 10 12 7 13 6 14 8 15 7 16 6 17 4...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT