Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please show work in formula method The US Dept of Energy captures data on the nu

ID: 3325929 • Letter: P

Question


Please show work in formula method

The US Dept of Energy captures data on the number of gallons of gasoline delivered to retail gas stations in the U.S. and the national average price of a gallon. You have gathered this data on a monthly basis and wish to determine if there actually is a correlation between price and consumption, implying that there is 'elasticity of demand' for gasoline. Use the data on datasheet "gasoline" to do a regression analysis: 1. Develop and examine a scatter plot to determine if there appears to be a linear relationship between the variables 2. Calculate Pearson's r and r2 then interpret the result:s 3. Calculate the regression equation coefficients 4. Evaluate the significance of the overall regression equation.

Explanation / Answer

The data is not shared in the question

---- Solution ----

a) Scatter plot

price = variable for price of gasoline

cons = variable for consumption of gasoline

plot(y = price, x = cons, type = "p")

If the plot has a positive or negative trend (the way Y moves with change in X, there is some linear relationship b/w the two variables

b) To calculate Pearson's correlation:-

r = cor(y = price, x = cons, method = "pearson")

If it is positive, Y increases with X (the magnitude is proportional to strength of linear relationship)

If it is negative, Y decreases with X (the magnitude is proportional to strength of linear relationship)

If it is near zero, Y has very small linear relationship with X

c) To calculate linear regression co-efficients,

fit = lm(price ~ cons)

summary(fit)

=> The output of summary function will give regression co-efficient for the variable "cons"

d) The column p-value in the same output will give the significance level.

If p-value << 0.01, the result is of HIGH significance.

---- Solution ----