Description Usage Arguments Value See Also Examples

This function generates graphs of the mean simulated vs. observed values at each time point of the time-varying covariates under the natural course. For categorical covariates, the observed and simulated counts of the levels of the factors are plotted at each time point.

1 2 3 4 5 6 7 8 9 10 11 12 |

`x` |
Object of class "gformula_binary_eof". |

`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 |

`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 |

`legend` |
Character string specifying the legend position. Valid values are |

`xlab` |
Character string for the x axes of all plots. By default, this argument is set to the |

`ylab_cov` |
Vector of character strings for the y axes of the plots for the covariates. This argument must be the same length as |

`...` |
Other arguments, which are passed to |

An object of class "ggarrange". See documentation of `ggarrange`

.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | ```
## Estimating the effect of threshold interventions on the mean of a binary
## end of follow-up outcome
id <- 'id_num'
time_name <- 'time'
covnames <- c('cov1', 'cov2', 'treat')
outcome_name <- 'outcome'
histories <- c(lagged, cumavg)
histvars <- list(c('treat', 'cov1', 'cov2'), c('cov1', 'cov2'))
covtypes <- c('binary', 'zero-inflated normal', 'normal')
covparams <- list(covmodels = c(cov1 ~ lag1_treat + lag1_cov1 + lag1_cov2 + cov3 +
time,
cov2 ~ lag1_treat + cov1 + lag1_cov1 + lag1_cov2 +
cov3 + time,
treat ~ lag1_treat + cumavg_cov1 +
cumavg_cov2 + cov3 + time))
ymodel <- outcome ~ treat + cov1 + cov2 + lag1_cov1 + lag1_cov2 + cov3
intvars <- list('treat', 'treat')
interventions <- list(list(c(static, rep(0, 7))),
list(c(threshold, 1, Inf)))
int_descript <- c('Never treat', 'Threshold - lower bound 1')
nsimul <- 10000
ncores <- 2
gform_bin_eof <- gformula_binary_eof(obs_data = binary_eofdata, id = id,
time_name = time_name,
covnames = covnames,
outcome_name = outcome_name,
covtypes = covtypes,
covparams = covparams,
ymodel = ymodel,
intvars = intvars,
interventions = interventions,
int_descript = int_descript,
histories = histories, histvars = histvars,
basecovs = c("cov3"), seed = 1234,
parallel = TRUE, nsamples = 5,
nsimul = nsimul, ncores = ncores)
plot(gform_bin_eof)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.