Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The forestfires.csv data base contains meteorological information and the area burned for 5 1 7 forest fires that occurred in Montesinho Natural Park in Portugal.

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:
model1_1 p-values are Intercept 1.384309e-96
RH 1.577449e-01
dtype: float64
model1_2 p-values are Intercept 3.710545e-158
DMC 8.598943e-01
dtype: float64
model1_3 p-values are Intercept 3.005972e-138
DC 2.139832e-02
dtype: float64
model1_4 p-values are Intercept 4.580488e-144
ISI 5.785291e-01
dtype: float64
model2_1 p-values are Intercept 1.284725e-75
RH 1.838245e-01
DC 2.450738e-02
dtype: float64
model2_2 p-values are Intercept 2.969390e-136
DMC 1.642624e-02
DC 9.065366e-04
dtype: float64
model2_3 p-values are Intercept 1.656648e-113
DC 2.569129e-02
ISI 9.756819e-01
dtype: float64
model3_1 p-values are Intercept 3.247158e-76
RH 3.108264e-01
DMC 2.520680e-02
DC 1.521100e-03
dtype: float64
model3_2 p-values are Intercept 3.674604e-114
DMC 1.397040e-02
DC 9.735041e-04
ISI 5.855461e-01
dtype: float64
# 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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions

Question

Consider the following four structures: (i) See Figure 9.23:

Answered: 1 week ago