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

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 Jan. 4, 2024, 2:23 p.m.