Question: Please answer in python using template provided and so the output matches exactly # import the necessary modules fires = # read in the csv

Please answer in python using template provided and so the output matches exactly
# import the necessary modules
fires = # read in the csv file
# response variable
Y = # set area as the response variable
# first forward selection step
model1_1= # generate the linear regression model for FFMC
# prints the p-value
print("model1_1 p-values are ", model1_1.pvalues)
model1_2= # generate the linear regression model for wind
print("model1_2 p-values are ", model1_2.pvalues)
model1_3= # generate the linear regression model for DC
print("model1_3 p-values are ", model1_3.pvalues)
model1_4= # generate the linear regression model for temp
print("model1_4 p-values are ", model1_4.pvalues)
# Second forward selection step using order FFMC, wind, DC, temp. Ex: If the best SLR model uses temp, the first MLR model should be Y ~ FFMC + temp.
model2_1= # generate multiple regression model
print("model2_1 p-values are ", model2_1.pvalues)
model2_2= # generate multiple regression model
print("model2_2 p-values are ", model2_2.pvalues)
model2_3= # generate multiple regression model
print("model2_3 p-values are ", model2_3.pvalues)
# Third forward regression step using order FFMC, wind, DC, temp
model3_1= # generate multiple regression model
print("model3_1 p-values are ", model3_1.pvalues)
model3_2= # generate multiple regression model
print("model3_2 p-values are ", model3_2.pvalues)
# Continue until no additional predictor variables have p-values less than 0.15.The forestfires.csv data base contains meteorological information and the area burned for 517 forest fires that occurred in Montesinho
Natural Park in Portugal. The columns of interest are FFMC, DMC, DC, and ISI, as well as the response variable, area.
Read in the file forestfires.csv.
Use the ols() function to perform forward selection stepwise regression on the variables FFMC, DMC, DC, and ISI, in that order.
Continue the stepwise regression until no new variables have a p-value less than 0.15.
Ex: If the variable RH is used instead of FFMC, the output is:
 Please answer in python using template provided and so the output

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!