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
model # generate the linear regression model for FFMC
# prints the pvalue
printmodel pvalues are modelpvalues
model # generate the linear regression model for wind
printmodel pvalues are modelpvalues
model # generate the linear regression model for DC
printmodel pvalues are modelpvalues
model # generate the linear regression model for temp
printmodel pvalues are modelpvalues
# 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.
model # generate multiple regression model
printmodel pvalues are modelpvalues
model # generate multiple regression model
printmodel pvalues are modelpvalues
model # generate multiple regression model
printmodel pvalues are modelpvalues
# Third forward regression step using order FFMC wind, DC temp
model # generate multiple regression model
printmodel pvalues are modelpvalues
model # generate multiple regression model
printmodel pvalues are modelpvalues
# Continue until no additional predictor variables have pvalues less than The forestfires.csv data base contains meteorological information and the area burned for 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 pvalue less than
Ex: If the variable is used instead of FFMC the output is:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
