Plot method for objects of class "gformula_survival"
Plot method for objects of class "gformula_survival"
This function generates graphs of the mean simulated vs. observed values at each time point of the time-varying covariates, risk, and survival under the natural course. For categorical covariates, the observed and simulated probability of each level are plotted at each time point.
covnames: Vector of character strings specifying the names of the time-varying covariates to be plotted. The ordering of covariates given here is used in the plot grid. Time-varying covariates of type "categorical time" cannot be included. To plot none of the time-varying covariates, set this argument to NA. By default, this argument is set equal to the covnames argument used in gformula_survival, where covariates of type 'categorical time' are removed.
risk: Logical scalar indicating whether to include a plot for the risk. The default is TRUE.
survival: Logical scalar indicating whether to include a plot for the survival. The default is FALSE.
ncol: Number of columns in the plot grid. By default, two columns are used when there is at least two plots.
nrow: Number of rows in the plot grid. By default, a maximum of six rows is used and additional plots are included in subsequent pages.
common.legend: Logical scalar indicating whether to include a legend. The default is TRUE.
legend: Character string specifying the legend position. Valid values are "top", "bottom", "left", "right", and "none". The default is "bottom".
xlab: Character string for the x axes of all plots. By default, this argument is set to the time_name argument specified in gformula_survival.
ylab_cov: Vector of character strings for the y axes of the plots for the covariates. This argument must be the same length as covnames. The i-th element of this argument corresponds to the plot for the i-th element of covnames.
ylab_risk: Character string for the y axis of the plot for the risk (if applicable). The default is "risk".
ylab_surv: Character string for the y axis of the plot for the survival (if applicable). The default is "survival".
pos_risk: Integer specifying the position at which to order the risk plot (if applicable). By default, this argument is set to the number of plots in the grid minus one (i.e., orders the risk plot second last).
pos_surv: Integer specifying the position at which to order the survival plot (if applicable). By default, this argument is set to the number of plots in the grid (i.e., orders the survival plot last).
ci_risk: Logical scalar specifying whether to include error bars for the 95% confidence intervals of the estimated risk under the natural course. This argument is only effective if the argument nsamples was set to a positive value in gformula_survival. The default is TRUE.
...: Other arguments, which are passed to ggarrange.
Returns
An object of class "ggarrange". See documentation of ggarrange.