Prepare aggregate data (AgD) from the comparator treatment for an unanchored indirect comparison. Supports binary, continuous, and count outcomes.
Usage
set_agd_unanchored(
data,
treatment,
outcome_n = NULL,
outcome_r = NULL,
outcome_y = NULL,
outcome_se = NULL,
outcome_E = NULL,
cov_means,
cov_sds = NULL,
cov_types = NULL,
study = NULL,
likelihood = c("binomial", "normal", "poisson")
)Arguments
- data
Data frame containing AgD summary statistics
- treatment
Column name for treatment variable
- outcome_n
Column name for sample size (binomial) or not used (normal/poisson)
- outcome_r
Column name for number of events (binomial) or counts (poisson)
- outcome_y
Column name for continuous outcome mean (normal likelihood)
- outcome_se
Column name for standard error (normal likelihood)
- outcome_E
Column name for exposure/time at risk (poisson likelihood)
- cov_means
Character vector of column names for covariate means
- cov_sds
Character vector of column names for covariate SDs (NULL for binary covariates)
- cov_types
Character vector specifying "continuous" or "binary" for each covariate
- study
Column name for study identifier (optional)
- likelihood
Outcome type: "binomial" (binary), "normal" (continuous), or "poisson" (count). Default "binomial".
Examples
if (FALSE) { # \dontrun{
# Binary outcome
agd <- set_agd_unanchored(
data = trial_b_data,
treatment = "trt",
outcome_n = "n_total",
outcome_r = "n_events",
cov_means = c("age_mean", "sex_prop"),
cov_sds = c("age_sd", NA),
cov_types = c("continuous", "binary"),
likelihood = "binomial"
)
# Continuous outcome
agd <- set_agd_unanchored(
data = trial_data,
treatment = "trt",
outcome_y = "mean_change",
outcome_se = "se_change",
cov_means = c("age_mean"),
cov_sds = c("age_sd"),
likelihood = "normal"
)
# Count outcome
agd <- set_agd_unanchored(
data = trial_data,
treatment = "trt",
outcome_r = "event_count",
outcome_E = "total_exposure",
cov_means = c("age_mean"),
cov_sds = c("age_sd"),
likelihood = "poisson"
)
} # }