use "https://www3.nd.edu/~rwilliam/statafiles/logist.dta", clear logit grade gpa tuce psi logit grade gpa tuce psi, or nolog logistic grade gpa tuce psi logistic grade gpa tuce psi, coef * Model 0: Intercept only quietly logit grade est store M0 * Model 1: GPA added quietly logit grade gpa est store M1 * Model 2: GPA + TUCE quietly logit grade gpa tuce est store M2 * Model 3: GPA + TUCE + PSI quietly logit grade gpa tuce psi est store M3 * Model 1 versus Model 0 lrtest M1 M0 * Model 2 versus Model 1 lrtest M2 M1 * Model 3 versus Model 2 lrtest M3 M2 * Model 3 versus Model 0 lrtest M3 M0 logit grade gpa tuce psi lrdrop1 test psi nestreg, lr store(m): logit grade gpa tuce psi lrtest m3 m1 nestreg, lr: logit grade gpa (tuce psi) lrtest m3 m1, stats fitstat estat class quietly logit grade gpa tuce psi * get the predicted log odds for each case predict logodds, xb * get the odds for each case gen odds = exp(logodds) * get the predicted probability of success predict p, p list grade gpa tuce psi logodds odds p * Probability of getting an A quietly logit grade gpa tuce i.psi margins psi, at(gpa = 3 tuce = 20) margins psi, at(gpa = 4 tuce = 25) margins psi, at(gpa = 4 tuce = 25) predict(xb) margins psi, at(gpa = 4 tuce = 25) expression(exp(predict(xb))) sw, pe(.05) lr: logit grade gpa tuce psi * Generate predicted probability of success predict p, p * Generate standardized residuals predict rstandard, rstandard * Generate the deviance residual predict dev, deviance * Use the extremes command to identify large residuals extremes rstandard dev p grade gpa tuce psi collin gpa tuce psi if !missing(grade) logit grade gpa tuce psi, robust