library(epicalc)

data(birthwt,package="MASS")

frace <- factor(birthwt$race)

levels(frace) <- c("white","black","other")

res <- glm(low~age+frace+smoke,birthwt,family="binomial")

logistic.display(res)

lroc(res,title=T,auc.coords=c(.5,.1))

# ロジスティック回帰: logit p(x) = x’b

#               |   (+)   |  (-)  |

#  - - - - - - - - - - - - - - - -

# p(x) > c  |     a    |   b   |

#  - - - - - - - - - - - - - - - -

# p(x) < c  |     c    |   d   |

#  - - - - - - - - - - - - - - - -

#               |    n+   |  n-  |

# 感度:Sensitivity = a / n+

# 特異度:Specificity = d / n-