Description Usage Arguments Value Author(s) Examples
Predicted probabilities and confidence intervals from logit or probit model
1 |
model |
A |
predData |
A data frame to pass to |
ci |
Logical value indicating whether to compute confidence intervals. |
level |
The confidence level to use if |
A data frame with predData
and the associated predicted probabilities.
Confidence intervals are included if argument ci
is TRUE
.
Jonah Gabry <jsg2201@columbia.edu>
1 2 3 4 5 6 7 8 9 10 11 12 | GSS_2010$Y <- with(GSS_2010,
cut(realinc,
breaks=c(-Inf, median(realinc, na.rm = T), Inf),
labels=c("Low", "High")))
logitmodel <- glm(Y ~ age + educ, data = GSS_2010, family = binomial)
probitmodel <- glm(Y ~ age + educ, data = GSS_2010, family = binomial(link = "probit"))
predData <- data.frame(age = 20, educ = 15)
predProb(logitmodel, predData, ci = F)
predProb(probitmodel, predData, ci= F)
predData <- expand.grid(age = c(20, 50, 80), educ = c(5, 10, 15))
predProb(logitmodel, predData, ci = T)
predProb(probitmodel, predData, ci= T)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.