nt_multiple_glm: Multivariable Generalized Linear models

nt_multiple_glmR Documentation

Multivariable Generalized Linear models

Description

Tabulating results from multivariable GLMs.

Usage

nt_multiple_glm(
  fit,
  exponentiate = FALSE,
  ci_type = "Wald",
  contrast_qt = "one-unit",
  user_contrast = NULL,
  user_contrast_interaction = NULL,
  table_reference = TRUE,
  format = TRUE,
  labels = NULL,
  digits = 2,
  digits_p = 3,
  save = FALSE,
  file = "nt_multiple_glm"
)

Arguments

fit

a glm object.

exponentiate

a logical value indicating whether coefficients should be exponentiated.

ci_type

a character value indicating the procedure to calculate confidence intervals: likelihood ratio (profile) or wald (wald).

contrast_qt

a character indicating whether the contrast for quantitative covariates. Options are every one-unit of change (one-unit), quartiles (quartiles) or provided by the user (user).

user_contrast

a variable named list of numerical vectors indicating contrast for a covariate.

user_contrast_interaction

a variable named list of numerical vectors indicating a contrast for interaction.

table_reference

a logical value indicating whether the output should be presented with a line indicating the reference category.

format

a logical value indicating whether the output should be formatted.

labels

a list of labels with components given by their variable names.

digits

a numerical value defining of digits to present the results.

digits_p

a numerical value defining number of digits to present the p-values.

save

a logical value indicating whether the output should be saved as a csv file.

file

a character indicating the name of output file in csv format to be saved.

Examples

library(titanic)
library(dplyr)

data(titanic_train)
dt <- titanic_train |> mutate(Sex = factor(Sex,
                                           levels = c("male", "female"),
                                           labels = c("Male", "Female")),
                              Pclass = factor(Pclass,
                                              levels = 1:3,
                                              labels = c("I", "II", "III"))
                              )

fit <- glm(Survived ~ Age + Sex + Pclass, data = dt, family = "binomial")

nt_multiple_glm(fit, exponentiate = TRUE)


dnzmarcio/ntimes documentation built on Feb. 5, 2025, 8:57 a.m.