plot.xmean.ordinaly(x, data, subset, na.action, subn=TRUE, cr=FALSE, ...)
na.keep
so all NAs are initially retained. Then NAs
are deleted only for each predictor currently being plotted.
Specify
na.action=na.delete
to remove observations that are missing
on any of the predictors (or the response).
FALSE
to suppress a left bottom subtitle specifying the sample size
used in constructing each plot
TRUE
to plot expected values by levels of the response, assuming a
forward continuation ratio model holds. The function is fairly slow
when this option is specified.
plot
and
lines
Frank Harrell
Department of Biostatistics
Vanderbilt University
f.harrell@vanderbilt.edu
Harrell FE et al. (1998): Development of a clinical prediction model for an ordinal outcome. Stat in Med 17:909–44.
# Simulate data from a population proportional odds model set.seed(1) n <- 400 age <- rnorm(n, 50, 10) blood.pressure <- rnorm(n, 120, 15) L <- .2*(age-50) + .1*(blood.pressure-120) p12 <- plogis(L) # Pr(Y>=1) p2 <- plogis(L-1) # Pr(Y=2) p <- cbind(1-p12, p12-p2, p2) # individual class probabilites # Cumulative probabilities: cp <- matrix(cumsum(t(p)) - rep(0:(n-1), rep(3,n)), byrow=TRUE, ncol=3) y <- (cp < runif(n)) %*% rep(1,3) # Thanks to Dave Krantz <dhk@paradox.psych.columbia.edu> for this trick par(mfrow=c(1,2)) plot.xmean.ordinaly(y ~ age + blood.pressure, cr=TRUE) par(mfrow=c(1,1))