Exploratory Analysis - 4

Logistic Regression with 1 Qualitative and 1 Quantitative Variable
(Pass/Fail on x = Sex and Gravity)

First, let's perform logisitic regression of passing or failing the test on the variables sex and gravity using the following models:

Model: logit [π(sex, gravity)] = β0+ β1* (sex) + β2*gravity

0+ β1) + β2*gravity, for females, and
0+ 2β1) + β2*gravity, for males

We can use the first PROC LOGISTIC procedure in the following SAS program water_level3a.sas to run this.

SAS program

First we are testing:

H0 : sex and gravity together do not affect passing the water level task, or

H0 : β1 = β2 = 0 vs. Ha: at least one of the parameters is not 0.

We can see by the output that results:

SAS output

that G2 = 50.9766 = LRT .

We will conclude that the logistic regression of pass/fail on sex and gravity is not statistically significant.

SAS output

The estimated logit(sex, gravity) = -4.1676 + 1.1220sex + 0.7404gravity.

Note that sex is coded as 1 for females and 2 for males.

No Gravity Effect, Adjusted for Sex?

If we were to test the hypothesis that there is no gravity effect, adjusted for 'sex', we would calculate the change in G2 for the model with both variables included and the model with only sex included (see water_level1.sas output). For instance,

G2 (sex, gravity) - G2(sex) = 50.9766 - 42.1765 = 8.801.

Or, we could calculate the change in the 2loglikelihood:

-2ln(sex) - [-2ln(sex, gravity)] = 183.859 - 175.059 = 8.800

Compare this with the Wald chi-square of 8.6117.

No Sex Effect, Adjusted for Gravity?

Now let's test the hypothesis that there is no sex effect, adjusted for the gravity score. We would calculate the change in G2 for the model with both variables included and the model with only gravity (see water_level2.sas output).

G2 (sex, gravity) - G2(gravity) = 50.9766 - 18.6568 = 32.319.

Or, we could calculate the change in the 2loglikelihood:

-2ln(gravity) - [-2ln(sex, gravity)] = 207.478 - 175.059 = 32.419

Now, how does this compare this with the Wald chi-square of 25.4979?

SAS output

Predicted values and confidence limits for population proportions:

SAS output

Edited fitted values are given below.

edited values here...

A plot of phat vs. gravity for females and males is given in the graph.

graph here...

Logistic Regression of Pass/Fail on Sex, Gravity and Sex* Gravity (Interaction Model)

Here our model is:

Model: logit [π(sex, gravity)] = β0+ β1* (sex) + β2*gravity + β3*(sex*gravity)

0+ β1) + (β2 + β3)gravity, for females, and
0+ 2β1) + (β2 + 2β3)gravity, for males

SAS output:

SAS output

SAS output