View source: R/splinePlot.lrm.R
splinePlot.lrm | R Documentation |
Plotting the prediction of a logistic regression model with confidence bands against one continuous variable.
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,
...
)
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 |
Function which extracts from a logistic regression model
fitted with rms::lrm
the predicted risks or odds.
Thomas A. Gerds <tag@biostat.ku.dk>
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.