Learn R Programming

outstandR (version 1.0.0)

gcomp_ml.boot: Bootstrap for G-computation via Maximum Likelihood

Description

This is a statistic function intended for use with a bootstrapping function (e.g., boot::boot()). On each bootstrap sample of the data, it calculates a relative treatment effect (e.g., log odds ratio, log relative risk, or risk difference) using G-computation with maximum likelihood.

Usage

gcomp_ml.boot(
  data,
  indices,
  R,
  formula = NULL,
  family,
  trt_var,
  ref_trt = NA,
  comp_trt = NA,
  rho = NA,
  N = 1000,
  marginal_distns = NA,
  marginal_params = NA,
  ald
)

Value

A single numeric value representing the relative treatment effect

Arguments

data

A data frame containing the original individual participant data (IPD).

indices

A vector of indices supplied by the bootstrapping function, used to resample data.

formula

Linear regression formula object. Prognostic factors (PF) are main effects and effect modifiers (EM) are interactions with the treatment variable, e.g., y ~ X1 + trt + trt:X2. For covariates as both PF and EM use * syntax.

family

A 'family' object specifying the distribution and link function (e.g., 'binomial'). See stats::family() for more details.

rho

A named square matrix specifying the correlation between covariates for synthetic data generation. Defaults to NA, assuming independence.

N

Synthetic sample size for G-computation

marginal_distns, marginal_params

Marginal distributions and parameters

ald

A data frame of aggregate-level data providing covariate distributions.

See Also

strategy_gcomp_ml()