create_glm_output_table: Creating Tidy Output Table from GLM Object

View source: R/create_glm_output_table.R

create_glm_output_tableR Documentation

Creating Tidy Output Table from GLM Object

Description

This function is designed to extract the key information from a GLM object and compile it into a tidy dataframe for use in R Markdown reports. Information includes coefficient estimates, standard errors, odds ratios, Z statistics, and p-values.

Usage

create_glm_output_table(mod_glm, dat)

Arguments

mod_glm

This is an object of class 'glm'.

dat

This is the dataframe used in fitting the glm object.

Examples

x = rnorm(100, 0, 1)

xb = 3 + 4.2 * x

p = 1/(1 + exp(-xb))

y = rbinom(n = 100, size = 1, prob = p)

dat = data.frame(x, y)

mod_glm = glm(y ~ x, data = dat, family = "binomial")

glm_output = create_glm_output_table(mod_glm, dat)


UKBiostatCIRCL/UK-Biostat-CIRCL documentation built on June 30, 2022, 4:42 a.m.