plot.gformula {CICI} | R Documentation |
Plot dose-response curves
Description
Function to plot dose-response curves based on results returned from gformula
Usage
## S3 method for class 'gformula'
plot(x, msm.method = c("line","loess", "gam", "none"),
CI = FALSE, time.points = NULL,
cols = NULL, weight = NULL,
survival = FALSE,variable = "psi", difference = FALSE,
...)
Arguments
x |
An object of |
msm.method |
A string specifying the method to connect individual estimates into a curve (marginal structural model). One of |
CI |
Logical. If TRUE, confidence bands are drawn; or confidence intervals for specific points if both |
time.points |
A vector of time points for which the respective curves should be drawn. Default is all time points. |
cols |
A vector of strings specifying custom colours for each drawn curve. |
weight |
Weight vector of size "number of interventions times time points", that is used for the MSM if |
survival |
Logical. If TRUE, time refers to the x-axis (under the condition that it is indeed a survival setting). |
variable |
A string specifying the variable to be plotted under the natural course scenario (i.e., if |
difference |
Logical. If TRUE, differences of observed outcomes and outcomes under the natural intervention will be plotted (if |
... |
Further arguments to be passed on |
Details
Time points and variable names should be specified according to the labeling of the results table returned by gformula
.
Value
Draws an object of class
‘ggplot’.
Examples
data(EFV)
est <- gformula(X=EFV,
Lnodes = c("adherence.1","weight.1",
"adherence.2","weight.2",
"adherence.3","weight.3",
"adherence.4","weight.4"
),
Ynodes = c("VL.0","VL.1","VL.2","VL.3","VL.4"),
Anodes = c("efv.0","efv.1","efv.2","efv.3","efv.4"),
abar=seq(0,10,1)
)
plot(est)
plot(est, time.points=c(1,5))