dh.multGLM: Loop multiple GLM models and handle errors & non-convergence

View source: R/multGlm.R

dh.multGLMR Documentation

Loop multiple GLM models and handle errors & non-convergence

Description

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"
)

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".

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'.


lifecycle-project/ds-helper documentation built on Oct. 27, 2023, 2:08 p.m.