Module 7. Assignment:
Question A:
A1: Define the relationship model between the independent and the dependent variable.
The simple linear regression model is:
Y = a +bX + e, where:
y = dependent variable
x = independent variable
a = intercept (the value of y when x = 0)
b = slope
e = error
A2: Calculate the coefficients.
The calculated regression equation is:
y = 19.2056 + 3.2691x, where:
Intercept = 19.2056
Slope = 3.2691
Question B:
B1: Define the relationship model between the predictor and the response variable.
Discharge = a + b(waiting)
Discharge = response variable
Waiting = predictor variable
B2: Extract the parameters of the estimated regression equation with the coefficients function.
My model is:
discharge = -1.874 + 0.0756(waiting), where:
Intercept = -1.874
waiting = 0.0756
B3: Determine the fit of the eruption duration using the estimated regression equation.
y = -1.874 + 0.0756(80)
y = -1.874 + 6.0504
y = 4.1764
Therefore, if the waiting time is 80 minutes, then the predicted discharge duration is approximately:
4.18 minutes.
Question C:
C1: Examine the relationship Multi Regression Model as stated above and its Coefficients using 4 different variables from mtcars (mpg, disp, hp and wt).
Report on the result and explanation what does the multi regression model and coefficients tell about the data.
The regression model for mpg is:
mpg = a + b1(disp) + b2(hp) + b3(wt)
Based on the output in the console, our coefficients are:
a = 37.11
b1 = -0.0009
b2 = -0.0312
b3 = -3.80
Therefore, our formula becomes:
mpg = 37.11 - 0.0009(disp) - 0.0312(hp) - 3.80(wt)
Explanation:
The model tell us that weight and horsepower affect mpg much more compared to displacement. Specifically weight as it has the strongest effect and for every 1000 pounds of weight added, mpg decreases by 3.8. To add, for every one unit of horsepower added, mpg decreases by 0.03. Displacement only decreases mpg by 0.0009 for every one unit, which isn't that significant.
Overall, heavier cars and/or cars with more powerful engines have worse gas mileage compared to lighter, less powerful cars.



Comments
Post a Comment