plot.OR {flexOR} | R Documentation |
plot.OR: Plot Smooth Odds Ratios
Description
Plots smooth odds ratios along with confidence intervals for a specified predictor.
Usage
## S3 method for class 'OR'
plot(
x,
predictor,
prob = NULL,
ref.value = NULL,
conf.level = 0.95,
round.x = NULL,
ref.label = NULL,
col,
col.area,
main,
xlab,
ylab,
lty,
xlim,
ylim,
xx,
ylog = TRUE,
log = ifelse(ylog, "", "y"),
...
)
Arguments
x |
An object of class "OR" generated by the |
predictor |
The name of the predictor variable for which to plot the smooth odds ratios. |
prob |
The probability level for the confidence interval. Default is NULL. |
ref.value |
The predicted value at which to calculate the smooth odds ratios. Default is NULL. |
conf.level |
The confidence level for the intervals. Default is 0.95. |
round.x |
The number of decimal places to round the predictor variable values. Default is NULL. |
ref.label |
The label for the reference value of the predictor variable. Default is NULL. |
col |
Vector of colors for plotting. Default is c("black", "black", "grey85"). |
col.area |
Vector of colors for the confidence intervals. |
main |
The title of the plot. Default is generated based on the predictor variable. |
xlab |
Label for the x-axis. Default is the name of the predictor variable. |
ylab |
Label for the y-axis. Default is "Ln OR(Z,Zref)" if logarithmic scale is used, else "OR(Z,Zref)". |
lty |
Vector of line types for plotting. Default is c(1, 3). |
xlim |
Range of the x-axis. Default is NULL. |
ylim |
Range of the y-axis. Default is NULL. |
xx |
Values for tick marks on the x-axis. Default is NULL. |
ylog |
Logical. If TRUE, y-axis is on a logarithmic scale. Default is TRUE. |
log |
Use a logarithmic scale for the y-axis (alternative argument name). |
... |
Additional arguments passed to plotting functions. |
Value
This function doesn't return a value. It is used for generating a plot.
Examples
library(gam);
# Load dataset
data(PimaIndiansDiabetes2, package="mlbench");
mod1 <- flexOR(
data=PimaIndiansDiabetes2,
response="diabetes",
formula=~s(age, 3.3) + s(mass, 4.1) + pedigree
);