View source: R/pmrm_simulate.R
| pmrm_simulate | R Documentation |
Simulate data from a progression model for repeated measures.
pmrm_simulate(
patients,
visit_times,
spline_knots,
spline_method,
tau,
alpha,
beta,
gamma,
sigma,
rho,
slowing,
proportional
)
patients |
Positive integer scalar, total number of patients in the output dataset. Patients are allocated (roughly) uniformly across the study arms. |
visit_times |
Numeric vector, the continuous scheduled time after randomization of each study visit. |
spline_knots |
Numeric vector of spline knots on the continuous scale, including boundary knots. |
spline_method |
Character string, spline method to use for the base model.
Must be |
tau |
Positive numeric scalar, standard deviation for jittering the simulated time points. Defaults to 0 so that the observed continuous times are just the scheduled visit times. |
alpha |
Numeric vector of spline coefficients for simulating
the mean function |
beta |
Treatment effect parameters. Input format and interpretation vary from model to model. |
gamma |
Numeric vector of model coefficients for covariate adjustment.
The simulation functions in |
sigma |
A positive numeric vector of visit-level standard deviation parameters. |
rho |
A finite numeric vector of correlation parameters.
Must have length |
A tibble with simulated clinical data
(see the "Simulated data" section).
The datasets returned from the simulation functions
have one row per patient visit and the following columns
which conform to the notation from vignette("models", package = "pmrm"):
patient: Character vector of patient ID labels.
visit: Ordered factor of clinical visits with labels included.
min(visit) indicates the baseline visit.
arm: Ordered factor of study arms with visits included.
min(arm) indicates the control arm.
i: integer ID of each patient.
j: integer ID of each clinical visit.
j == 1 at baseline.
k: integer ID of the study arm of patient i.
k == 1 for the control arm.
y: clinical outcomes.
t: observed continuous time since baseline.
beta: the scalar component of the treatment effect parameter
beta defined for patient i.
mu: expected clinical outcome at the given patient visit.
w_*: columns of the covariate adjustment model matrix W.
e: residuals.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.