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 19:30
The amount spent on food and drink by 20 customers is shown below what is the modal amount spent and the median? 40 25 8 36 18 15 24 27 43 9 12 19 22 34 31 20 26 19 17 28
Answers: 1
question
Mathematics, 21.06.2019 21:50
5. which description does not guarantee that a quadrilateral is a squar ajo is a parallelogram with perpendicular diagonals 0% has all sides congruent and all angles congruent o has all right angles and has all sides congruent 10% is both a rectangle and a rhombus 30%
Answers: 2
question
Mathematics, 22.06.2019 01:30
The host of a game show is holding a bag with chips to see what prizes the contestants will play for. five (5) of the chips say “new car” ten (10) of the chips say “new tv” three (3) of the chips say “trip to france” contestant named “patty” reaches into the bag. a. what is the probability of choosing a tv chip? b. what is the probability of choosing a car chip next without replacing the 1st chip? c. are these dependent or independent events?
Answers: 1
question
Mathematics, 22.06.2019 02:00
If the angle bisectors of a pair of opposite angles of a quadrilateral are the opposite sides of a parallelogram formed by the two angle bisectors and two sides of the quadrilateral, is the quadrilateral always a parallelogram? explain your answer.
Answers: 3
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
Computers and Technology, 03.12.2021 21:40
Questions on the website: 13722363