subject
Mathematics, 05.07.2021 19:30 EnzoF17

Can anyone tell me how to write this block of code? Step 6: Multiple Regression: Predicting the Total Number of Wins using Average Points Scored, Average Relative Skill, and Average Points Differential
The coach also wants you to consider the average points differential as a predictor variable in the multiple regression model. Create a multiple regression model with the total number of wins as the response variable, and average points scored, average relative skill, and average points differential as predictor variables. This regression model will help your coach predict how many games your team might win in a regular season based on metrics like the average score, average relative skill, and the average points differential between the team and their opponents.
You are to write this code block yourself.
Use Step 5 to help you write this code block. Here is some information that will help you write this code block. Reach out to your instructor if you need help.
The dataframe used in this project is called nba_wins_df.
The variable avg_pts represents average points scored by each team in a regular season.
The variable avg_elo_n represents average relative skill of each team in a regular season.
The variable avg_pts_differential represents average points differential between each team and their opponents in a regular season.
Print the model summary.
Here is step 5:
Step 5: Multiple Regression: Predicting the Total Number of Wins using Average Points Scored and Average Relative Skill
Instead of presenting a simple linear regression model to the coach, you can suggest a multiple regression model with the total number of wins as the response variable and the average points scored and the average relative skill as predictor variables. This regression model will help your coach predict how many games your team might win in a regular season based on metrics like the average points scored and average relative skill. This model is more practical because you expect more than one performance metric to determine the total number of wins in a regular season. Create this multiple regression model. Make the following edits to the code block below:
Replace ??RESPONSE_VARIABLE?? with the variable name that is being predicted. See the table included in the Project Three instructions above. Do not enclose this variable in quotes. For example, if the variable name is var0 then replace ??RESPONSE_VARIABLE?? with var0.
Replace ??PREDICTOR_VARIABLE_1?? with the variable name for average points scored. Hint: See the table included in the Project Three instructions above. Do not enclose this variable in quotes. For example, if the variable name is var1 then replace ??PREDICTOR_VARIABLE_1?? with var1.
Replace ??PREDICTOR_VARIABLE_2?? with the variable name for average relative skill. Hint: See the table included in the Project Three instructions above. Do not enclose this variable in quotes. For example, if the variable name is var2 then replace ??PREDICTOR_VARIABLE_2?? with var2.
For example, if the variable names are var0 for the response variable and var1, var2 for the predictor variables, then the expression in the code block below should be: model = smf. ols('var0 ~ var1 + var2', nba_wins_df).fit()
After you are done with your edits, click the block of code below and hit the Run button above.
In [8]:
import statsmodels. formula. api as smf
​# Multiple Regression
# TODO: make your edits here ---
model2 = smf. ols('total_wins ~ avg_pts + avg_elo_n', nba_wins_df).fit()
print(model2.summary())
OLS Regression Results
Dep. Variable: total_wins R-squared: 0.837
Model: OLS Adj. R-squared: 0.837
Method: Least Squares F-statistic: 1580.
Date: Tue, 16 Jun 2020 Prob (F-statistic): 4.41e-243
Time: 22:28:19 Log-Likelihood: -1904.6
No. Observations: 618 AIC: 3815.
Df Residuals: 615 BIC: 3829.
Df Model: 2
Covariance Type: nonrobust

coef std err t P>|t| [0.025 0.975]

Intercept -152.5736 4.500 -33.903 0.000 -161.411 -143.736
avg_pts 0.3497 0.048 7.297 0.000 0.256 0.444
avg_elo_n 0.1055 0.002 47.952 0.000 0.101 0.110

Omnibus: 89.087 Durbin-Watson: 1.203
Prob(Omnibus): 0.000 Jarque-Bera (JB): 160.540
Skew: -0.869 Prob(JB): 1.38e-35
Kurtosis: 4.793 Cond. No. 3.19e+04

Warnings:
[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.
[2] The condition number is large, 3.19e+04. This might indicate that there are
strong multicollinearity or other numerical problems.

ansver
Answers: 3

Another question on Mathematics

question
Mathematics, 21.06.2019 17:00
Bugs bunny was 33 meters below ground, digging his way toward pismo beach, when he realized he wanted to be above ground. he turned and dug through the dirt diagonally for 80 meters until he was above ground
Answers: 3
question
Mathematics, 22.06.2019 00:00
Which of the following will form the composite function?
Answers: 3
question
Mathematics, 22.06.2019 00:30
You borrow $25,000 to buy a boat. the simple interest rate is 4%. you pay the loan off after 10 years. what is the total amount you paid for the loan?
Answers: 1
question
Mathematics, 22.06.2019 01:00
Libby built a fence that was 56 \text { feet}56 feet long over 44 days. she built the same length of fence each day. how many inches of fence did libby build each day?
Answers: 1
You know the right answer?
Can anyone tell me how to write this block of code? Step 6: Multiple Regression: Predicting the Tot...
Questions
question
Mathematics, 12.10.2020 16:01
question
Biology, 12.10.2020 16:01
question
Mathematics, 12.10.2020 16:01
question
Mathematics, 12.10.2020 16:01
question
Mathematics, 12.10.2020 16:01
Questions on the website: 13722363