Week 5 Discussion

docx

School

Southern New Hampshire University *

*We aren’t endorsed by this school

Course

243

Subject

Statistics

Date

Nov 24, 2024

Type

docx

Pages

5

Uploaded by Wahoobeauty

Report
5-3 Discussion: Simple Linear Regression Available on Saturday, May 29, 2021, 11:59 PM EDT Must post first. Use the link in the Jupyter Notebook activity to access your Python script. Once you have made your calculations, complete this discussion. The script will output answers to the questions given below. You must attach your Python script output as an HTML file and respond to the questions below. In this discussion, you will apply the statistical concepts and techniques covered in this week's reading about correlation coefficient and simple linear regression. A car rental company wants to evaluate the premise that heavier cars are less fuel-efficient than lighter cars. In other words, the company expects that fuel efficiency (miles per gallon) and the weight of the car (often measured in thousands of pounds) are correlated. Performing this analysis will help the company optimize its business model and charge its customers appropriately. In this discussion, you will work with a cars data set that includes two variables: Miles per gallon (coded as mpg in the data set) Weight of the car (coded as wt in the data set) The random sample will be drawn from a CSV file. This data will be unique to you, and therefore your answers will be unique as well. Run Step 1 in the Python script to generate your unique sample data. In your initial post, address the following items: 1. You created a scatterplot of miles per gallon against weight; check to make sure it was included in your attachment. Does the graph show any trend? If yes, is the trend what you expected? Why or why not? See Step 2 in the Python script. As the graph shows below, the trend shows the higher weight, the lower in miles per gallon. For instance, a vehicle that weighs 1.500 pounds can get 30 miles per gallon versus a car that weighs 5,500 pounds that gets 10 miles to the gallon. Although there are some outliners, the trend shows that the downward trend of miles per gallon lessens as the weight of the car increases.
2. What is the coefficient of correlation between miles per gallon and weight? What is the sign of the correlation coefficient? Does the correlation coefficient indicate a strong correlation, weak correlation, or no correlation between the two variables? How do you know? See Step 3 in the Python script. The correlation coefficient indicates a strong correlation as the coefficient is -0.890708, as you can see below between miles per gallon and weight. If the coefficient is between . 80 and 1, the correlation is firm, which shows the negative trend within the graph between the two variables. mpg wt mpg 1.000000 -0.890708 wt -0.890708 1.000000 3. Write the simple linear regression equation for miles per gallon as the response variable and weight as the predictor variable. How might the car rental company use this model? See Step 4 in the Python script. The simple linear equation is as follows: mpg = B 0 + B 1 mpg=38.997 +(-5.9137)
Using the value of the weight, the company can use the data to predict the miles per gallon and utilize the data to correctly charge the customer the per-mile charge in the rental agreement. 4. What is the slope coefficient? Is this coefficient significant at a 5% level of significance (alpha=0.05)? (Hint: Check the P-value, , for weight in the Python output.) See Step 4 in the Python script. From the python script, we get the following information: The slope efficiency is B 1 =− 5.9137 The p-value given by the code is P > | t | = 0.000 The coefficient significance is at a 5% level of significance. Therefore H 0 : B 1 = 0 H 1 : B 1 0 The coefficient is significant due to the p-value being less than the significant level. Therefore, we will reject the null hypothesis because the p-value of 0.000 is less than the significance level of . OLS Regression Results =========================================================================== === Dep. Variable: mpg R-squared: 0.793 Model: OLS Adj. R-squared: 0.786 Method: Least Squares F-statistic: 107.5 Date: Fri, 28 May 2021 Prob (F-statistic): 4.31e-11 Time: 14:11:15 Log-Likelihood: -72.886 No. Observations: 30 AIC: 149.8 Df Residuals: 28 BIC: 152.6 Df Model: 1 Covariance Type: nonrobust =========================================================================== === coef std err t P>|t| [0.025 0.975] --------------------------------------------------------------------------- ---
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Intercept 38.9779 1.876 20.774 0.000 35.134 42.821 wt -5.9137 0.570 -10.368 0.000 -7.082 4.745 =========================================================================== === Omnibus: 1.908 Durbin-Watson: 2.404 Prob(Omnibus): 0.385 Jarque-Bera (JB): 1.659 Skew: 0.547 Prob(JB): 0.436 Kurtosis: 2.639 Cond. No. 12.9 =========================================================================== === Warnings: [1] Standard Errors assume that the covariance matrix of the errors is correctly specified. In your follow-up posts to other students, review your peers' calculations and provide some analysis and interpretation: 1. How do their plots and correlation coefficients compare with yours? 2. Would you recommend this regression model to the car rental company? Why or why not? Remember to attach your Python output and respond to all questions in your initial and follow- up posts. Be sure to communicate your ideas using appropriate terminology. Finally, be sure to review the Discussion Rubric to understand how you will be graded on this assignment. Rubrics Discussion Rubric: Undergraduate
RESPONSE How do their plots and correlation coefficients compare with yours? Hi Dalila, our plots and correlation coefficients are very similar. Both of our plots show that there is a strong negative correlation between mpg and wt. My coefficient of correlation is -0.890708, yours is -0.878227, both of which are greater than -0.80 and less than -1.00 , which shows a strong negative correlation. Would you recommend this regression model to the car rental company? Why or why not? Yes, I would recommend this regression model to the car rental company. As you have also pointed out, the company could use this data to price fuel usage for different vehicles in their fleet. I think this is a great real-world example of the benefits of a properly calculated regression model. H 0 : B 1 = 0 H 1 : B 1 0 H 0 : B 1 = 0 Hello, John. In looking at your plots in comparison to mine, out coefficients seem to be similar. It seems that both of the plots show a strong negative correlation between the miles per gallon and the weight of the automobile, as both are greater than -0.80 and less than -1.00. My coefficient is -0.890708 and yours is -0.867529. I would recommend this regression model to the car company as the data can be used to charge a miles per gallon or a fuel use charge as different vehicles weight change the miles per gallon. Car rental companies use these types of real-world equations to charge the proper amount using a similar regression model for calculations.