Learn R Programming

outstandR (version 1.0.0)

gcomp_ml_means: G-computation maximum likelihood mean outcomes by arm

Description

G-computation maximum likelihood mean outcomes by arm

Usage

gcomp_ml_means(
  formula,
  family,
  ipd,
  ald,
  trt_var,
  rho = NA,
  N = 1000,
  ref_trt,
  comp_trt,
  marginal_distns = NA,
  marginal_params = NA
)

Value

A list containing:

  • stats: Named vector of marginal mean probabilities

  • model: The fitted glm object

Arguments

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.

ipd

Individual-level patient data. Dataframe with one row per patient with outcome, treatment and covariate columns.

ald

Aggregate-level data. Long format summary statistics for each covariate and treatment outcomes. We assume a common distribution for each treatment arm.

rho

A named square matrix of covariate correlations; default NA.

N

Synthetic sample size for g-computation

marginal_distns, marginal_params

Marginal distributions and parameters

See Also

strategy_gcomp_ml(), gcomp_ml.boot()