compute_contrast_observations
Description
Compute contrast observations for prediction plots
Usage
compute_contrast_observations( data, conc_col, dv_col, id_col = NULL, ntime_col = NULL, trt_col = NULL, treatment_predictors, control_predictors = NULL, contrast_method = c( "matched", "group"))
Arguments
Name | Description |
---|---|
data | a dataframe of QTc dataset |
conc_col | an unquoted column name of drug concentration measurements |
dv_col | an unquoted column name of dQTC measurements |
id_col | an unquoted column name of ID data, used when control predictors is provided to compute delta delta dv |
ntime_col | an unquoted column name of Nominal time data, used when control predictors is provided to compute delta delta dv |
trt_col | an unquoted column name of Treatment group data, used when control predictors is provided to compute delta delta dv |
treatment_predictors | a list for predictions with model. Should contain a value for each predictor in the model. |
control_predictors | an optional list for contrast predictions |
contrast_method | a string specifying contrast method: “matched” for individual ID+time matching (crossover studies), “group” for group-wise subtraction (parallel studies) |
Returns
a tibble with columns: group, conc, dv
Examples
data <- preprocess(data)
# Simple case: no control group obs_data <- compute_contrast_observations( data, CONC, deltaQTCF, treatment_predictors = list(TRTG = "Verapamil HCL") ) obs_data
# Matched contrast (crossover study) contrast_data <- compute_contrast_observations( data, CONC, deltaQTCF, ID, NTLD, TRTG, treatment_predictors = list(TRTG = "Verapamil HCL"), control_predictors = list(TRTG = "Placebo"), contrast_method = "matched" ) contrast_data
# A tibble: 643 × 3 group conc dv <chr> <dbl> <dbl> 1 Observations 0 -6.01 2 Observations 0 -12.0 3 Observations 0 -5.45 4 Observations 0 -22.5 5 Observations 0 1.29 6 Observations 0 -6.54 7 Observations 0 -12.5 8 Observations 0 -11.0 9 Observations 0 -7.7210 Observations 0 -2.76# ℹ 633 more rows# A tibble: 313 × 3 group conc dv <chr> <dbl> <dbl> 1 Observations 180 1.57 2 Observations 51.5 4.52 3 Observations 46.1 6.96 4 Observations 251 11.0 5 Observations 72.6 -10.5 6 Observations 201 1.58 7 Observations 91.1 -3.82 8 Observations 50 1.46 9 Observations 368 8.0910 Observations 37.8 -0.864# ℹ 303 more rows