The University of North Carolina
at Pembroke
THIRD GRADED EXERCISE
Logistic Regression
Due Tuesday sect.: April 24 or
Thursday sect.: April 19
-
Open the JMP IN dataset JMP IN data\Spring.jmp
-
Create a new variable called Dummy
Rained which will be 1 if Rained = "Rainy" and 0 if
Rained = "Dry"
-
To do this, double click on the column
head to the right of the last column.
-
Replace Column
15 with the variable name Dummy
Rained.
-
Right click on the column head and
click on Formula.
-
Type in the following formula exactly:
if(Rained=="Rainy",1,0)
The quotation marks are important and so is the double equal sign.
There are no periods in this formula--only commas.
-
Click on the OK
button.
-
Analyze the model using linear regression.
To do this,
-
Click on Analyze, then Fit Model.
-
Highlight Dummy
Rained and click on the Y
button.
-
Highlight Temp,
Humid1:pm, and Pressure
and click on the Add
button.
-
Click on the Run Model button.
-
Which regressors appear to be determining
whether the day is rainy? What pattern do you see in Residual by
Predicted plot? Does it seem that the model is linear? Save
the residuals and run the Shapiro-Wilk test on them (recall that that test
is under the Distribution tool). Can we believe that the residuals
come from a normal distribution? What is the effect of a 4-point
increase in Pressure
on the dependent variable? (use alpha = 0.08, Yes, that is
a bit large)
-
Analyze the model using logistic regression.
To do this,
-
Click on Analyze, then Fit Model.
-
Highlight Rained
and click on the Y
button.
-
Highlight Temp,
Humid1:pm, and Pressure
and click on the Add
button.
-
Click on the Run Model button.
-
When the report window appears, click
on the red triangle for the pop-up menu and click on Likelihood Ratio Tests.
-
Which regressors appear to be determining
whether the day is rainy? What is the p value for the whole
model? What is the logit R²? Does the lack of fit test
indicate that more variables need to be added to the model? What
is the effect of a 4-point increase in Pressure on the probability that
the day was rainy?
-
Given the differences between the model
results, which model should we believe?
Answers
to FAQs about Exercise #3