Description Usage Arguments Details Value Author(s) See Also Examples
Tabulate grouped risks predicted by two different methods, models, algorithms
1 |
list |
A list with two elements. Each element should
either be a vector with probabilities, or an object for
which |
newdata |
Passed on to |
cuts |
Risk quantiles to group risk |
digits |
Number of digits to show for the predicted risks |
All risks are multiplied by 100 before
reclassification table
Thomas A. Gerds <tag@biostat.ku.dk>
predictStatusProb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | set.seed(40)
N <- 40
X1 <- rnorm(N)
X2 <- rbinom(N,1,.4)
X3 <- rnorm(N)
expit <- function(x) exp(x)/(1+exp(x))
lp <- expit(X1 + X2 + X3)
Y <- factor(rbinom(N,1,lp))
dat <- data.frame(Y=Y,X1=X1,X2=X2,X3=X3)
lm1 <- glm(Y~X1,data=dat,family="binomial")
lm2 <- glm(Y~X1+X2,data=dat,family="binomial")
rc <- reclass(list("lrm.X1"=lm1,"lrm.X1.X2"=lm2),newdata=dat)
print(rc)
plot(rc)
rc2 <- reclass(list("lrm.X1"=lm1,"lrm.X1.X2"=lm2),newdata=dat,cuts=c(0,5,10,50,100))
print(rc2)
plot(rc2)
|
lrm.X1.X2
lrm.X1 0-25% 25-50% 50-75% 75-100%
0-25% 4 1 0 0
25-50% 2 10 3 0
50-75% 0 1 14 0
75-100% 0 0 0 5
lrm.X1.X2
lrm.X1 0-5% 5-10% 10-50% 50-100%
0-5% 0 0 0 0
5-10% 0 0 0 0
10-50% 0 0 17 3
50-100% 0 0 1 19
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.