Covariate adjustment using generalized linear working model, with simplified interface.

robincar_glm2(
  df,
  treat_col,
  response_col,
  formula = NULL,
  car_strata_cols = NULL,
  car_scheme = "simple",
  g_family = stats::gaussian,
  g_accuracy = 7,
  contrast_h = NULL,
  contrast_dh = NULL
)

Arguments

df

A data.frame with the required columns

treat_col

Name of column in df with treatment variable

response_col

Name of the column in df with response variable

formula

The formula to use for adjustment specified using as.formula("..."). This overrides car_strata_cols and covariate_cols.

car_strata_cols

Names of columns in df with car_strata variables

car_scheme

Name of the type of covariate-adaptive randomization scheme. One of: "simple", "pocock-simon", "biased-coin", "permuted-block".

g_family

Family that would be supplied to glm(...), e.g., binomial. If no link specified, will use default link, like behavior in glm. If you wish to use a negative binomial working model with an unknown dispersion parameter, then use `g_family="nb"`.

g_accuracy

Level of accuracy to check prediction un-biasedness.

contrast_h

An optional function to specify a desired contrast

contrast_dh

An optional jacobian function for the contrast (otherwise use numerical derivative)