orm
object generates a function for computing the
estimates of the function Prob(Y>=y) given one or more values of the
linear predictor using the reference (median) intercept. This
function can optionally be evaluated at only a set of user-specified
y
values, otherwise a right-step function is returned. There
is a plot method for plotting the step functions, and if more than one
linear predictor was evaluated multiple step functions are drawn.
ExProb
is especially useful for nomogram
.ExProb(object, ...)## S3 method for class 'orm':
ExProb(object, codes = FALSE, ...)
## S3 method for class 'ExProb':
plot(x, \dots, data=NULL,
xlim=NULL, xlab=x$yname, ylab=expression(Prob(Y>=y)),
col=par('col'), col.vert='gray85', pch=20,
pch.data=21, lwd=par('lwd'), lwd.data=lwd,
lty.data=2, key=TRUE)
orm
TRUE
, ExProb
use the integer codes
$1,2,\ldots,k$ for the $k$-level response instead of its
original unique valuesExProb
. Passed to plot
for
plot.ExProb
data
if you want to add stratified empirical
probabilities to the graph. If data
is a numeric vector, it
is assumed that no groups are present. Otherwise data
must
be a list or data frame where ExProb
y
FALSE
to suppress key in plot if data
is givenExProb
returns an R function. Running the function returns an
object of class "ExProb"
.orm
, Quantile.orm
set.seed(1)
x1 <- runif(200)
yvar <- x1 + runif(200)
f <- orm(yvar ~ x1)
d <- ExProb(f)
lp <- predict(f, newdata=data.frame(x1=c(.2,.8)))
w <- d(lp)
s1 <- abs(x1 - .2) < .1
s2 <- abs(x1 - .8) < .1
plot(w, data=data.frame(x1=c(rep(.2, sum(s1)), rep(.8, sum(s2))),
yvar=c(yvar[s1], yvar[s2])))
qu <- Quantile(f)
abline(h=c(.1,.5), col='gray80')
abline(v=qu(.5, lp), col='gray80')
abline(v=qu(.9, lp), col='green')
Run the code above in your browser using DataLab