View source: R/prepare_longitudinal_data.R
| prepare_longitudinal_surrogate_data | R Documentation |
This function standardizes a long-format data set to the internal variables used by the longitudinal model-fitting functions.
prepare_longitudinal_surrogate_data(
data,
id,
treatment,
time,
endpoint,
outcome,
surrogate_label,
true_label,
treatment_levels = c(0, 1),
baseline = NULL,
covariates = character(0)
)
data |
A data.frame in long format. |
id |
Character name of the subject identifier column. |
treatment |
Character name of the treatment column. |
time |
Character name of the measurement-time column. |
endpoint |
Character name of the endpoint-label column. |
outcome |
Character name of the observed outcome column. |
surrogate_label |
Label identifying the surrogate endpoint. |
true_label |
Label identifying the true endpoint. |
treatment_levels |
Two treatment values, ordered as control then active. |
baseline |
Optional character name of an endpoint-specific baseline value. |
covariates |
Optional character vector of additional baseline covariates. |
A standardized data.frame.
data(Schizo_PANSS_BPRS)
dat <- prepare_longitudinal_surrogate_data(
data = Schizo_PANSS_BPRS,
id = "Id",
treatment = "Treat",
time = "Time_cont",
endpoint = "Endpoint",
outcome = "Response_log",
baseline = "Baseline_log",
surrogate_label = "BPRS",
true_label = "PANSS",
treatment_levels = c(0, 1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.