whether the subject actually had a knee fracture: Five predictor variables will be used
to obtain predicted probabilities from a logistic regression for each individual in the
dataset. The model follows:
logit PðFRACTURE¼ 1 jXÞ¼b 0 þb 1 AGECATþb 2 HEADþb 3 PATELLAR
þb 4 FLEXþb 5 WEIGHTThe code to run this model is:
Logit fracture agecat head patellar flex weight, orThe output follows:
fracture Odds Ratio Std. Err. z P>jzj [95% Conf. Interval]
agecat 1.743647 .6964471 1.39 0.164 .7970246 3.814567
head 1.243907 .4678455 0.58 0.562 .595172 2.599758
patellar 1.871685 .6584815 1.78 0.075 .9392253 3.729888
flex 1.695114 .6345218 1.41 0.159 .8139051 3.530401
weight 4.50681 1.844564 3.68 0.000 2.020628 10.05199
Directly after running this model an ROC curve can be generated by using thelroc
command. The code and output follows:
lrocLogistic model for fractureNumber of observations¼ 348
Area under ROC curve¼0.74521.000.750.500.250.00
0.00 0.25Area under ROC curve = 0.74520.50
1 – specificitySensitivity0.75 1.00