Exploratory Analysis - 2

Logisitic Regression with a Qualitatitve (Categorical) Variable

Logistic Regression

Logistic Regression of Pass/Fail

Let's use logistic regression to test passing versus failing. We can test the model:

\(\text{Model: } ln\{\pi(sex)/[1-\pi(sex)]\}=\beta_0+\beta_1 \ast (sex)=\begin{array} {l @{\quad,\quad} l}
\beta_0+\beta_1 & \text{for females}\\ \beta_0 & \text{for males} \end{array} \)

and use the SAS program water_level1.sas below. This program uses the frequency counts for both sex and whether they passed the test:

sas program

What do the results indicate? In this case we can see that in testing the following:

H0: No Sex effect or H0 : β1 = 0 vs. the alternative Ha : β1 ≠ 0

the Likelihood Ratio, G2 = 18.6578 ...

SAS output

Therefore, we must reject null hypothesis - no sex effect - and conclude that there is statictically significant difference between females and males in proportion passing the test.

We can fit the model using these values from the output:

SAS output

where the

fitted logit(females) = 0.5931 - 1.4446 = -0.8515 for females
fitted logit(males) = 0.5931 for males

SAS output

The odds ratio (males vs. females) = s-1.4446 = 0.236

SAS output

The odds ratio = (38)(75)/(21)(32) = 4.24 = s-1.4446