Skip to contents

This function allows you to fit different glm models to different cohorts, for example if you want to include different covariates for different cohorts.

Usage

dh.multGLM(
  df = NULL,
  ref = NULL,
  checks = TRUE,
  conns = NULL,
  vary_df = F,
  family = "gaussian",
  weights = NULL
)

Arguments

df

Character specifying a server-side data frame.

ref

reference tibble, output from dh.buildModels.

checks

Logical; if TRUE checks are performed prior to running the function. Default is TRUE.

conns

DataSHIELD connections object.

vary_df

Option to provide different df for different models. Default is FALSE.

family

Family to use in glm models. Default is "gaussian".

weights

Optional, serverside object containing weights to be used in the model.

Value

Tibble containing five columns:

  • model = Description of model fit, taken from model_name.

  • formula = Formula for this model, taken from formulae.

  • cohort = Cohort for which this model was fit, taken from cohort.

  • fit = Output from glm model.

  • converged = Logical; whether or not the model converged/fit'.