splinePlot.lrm {Publish} | R Documentation |
Plot predictions of logistic regression
Description
Plotting the prediction of a logistic regression model with confidence bands against one continuous variable.
Usage
splinePlot.lrm(
object,
xvar,
xvalues,
xlim = range(xvalues),
ylim,
xlab = xvar,
ylab = scale[[1]],
col = 1,
lty = 1,
lwd = 3,
confint = TRUE,
newdata = NULL,
scale = c("risk", "odds"),
add = FALSE,
...
)
Arguments
object |
Logistic regression model fitted with |
xvar |
Name of the variable to show on x-axis |
xvalues |
Sequence of |
xlim |
x-axis limits |
ylim |
y-axis limits |
xlab |
x-axis labels |
ylab |
y-axis labels |
col |
color of the line |
lty |
line style |
lwd |
line width |
confint |
Logical. If |
newdata |
How to adjust |
scale |
Character string that determines the outcome scale (y-axis). Choose between |
add |
Logical. If |
... |
Further arguments passed to |
Details
Function which extracts from a logistic regression model
fitted with rms::lrm
the predicted risks or odds.
Author(s)
Thomas A. Gerds <tag@biostat.ku.dk>
Examples
data(Diabetes)
Diabetes$hypertension= 1*(Diabetes$bp.1s>140)
library(rms)
uu <- datadist(Diabetes)
options(datadist="uu")
fit=lrm(hypertension~rcs(age)+gender+hdl,data=Diabetes)
splinePlot.lrm(fit,xvar="age",xvalues=seq(30,50,1))
[Package Publish version 2023.01.17 Index]