h_glm_count: Helper functions for Poisson models

View source: R/summarize_glm_count.R

h_glm_countR Documentation

Helper functions for Poisson models

Description

[Experimental]

Helper functions that can be used to return the results of various Poisson models.

Usage

h_glm_poisson(.var, .df_row, variables, weights)

h_glm_quasipoisson(.var, .df_row, variables, weights)

h_glm_negbin(.var, .df_row, variables, weights)

h_glm_count(.var, .df_row, variables, distribution, weights)

h_ppmeans(obj, .df_row, arm, conf_level)

Arguments

.var

(string)
single variable name that is passed by rtables when requested by a statistics function.

.df_row

(data.frame)
dataset that includes all the variables that are called in .var and variables.

variables

(named list of string)
list of additional analysis variables, with expected elements:

  • arm (string)
    group variable, for which the covariate adjusted means of multiple groups will be summarized. Specifically, the first level of arm variable is taken as the reference group.

  • covariates (character)
    a vector that can contain single variable names (such as "X1"), and/or interaction terms indicated by "X1 * X2".

  • offset (numeric)
    a numeric vector or scalar adding an offset.

weights

(character)
a character vector specifying weights used in averaging predictions. Number of weights must equal the number of levels included in the covariates. Weights option passed to emmeans::emmeans().

distribution

(character)
a character value specifying the distribution used in the regression (Poisson, Quasi-Poisson, negative binomial).

obj

(glm.fit)
fitted model object used to derive the mean rate estimates in each treatment arm.

arm

(string)
group variable, for which the covariate adjusted means of multiple groups will be summarized. Specifically, the first level of arm variable is taken as the reference group.

conf_level

(proportion)
value used to derive the confidence interval for the rate.

Value

  • h_glm_poisson() returns the results of a Poisson model.

  • h_glm_quasipoisson() returns the results of a Quasi-Poisson model.

  • h_glm_negbin() returns the results of a negative binomial model.

  • h_glm_count() returns the results of the selected model.

  • h_ppmeans() returns the estimated means.

Functions

  • h_glm_poisson(): Helper function to return results of a Poisson model.

  • h_glm_quasipoisson(): Helper function to return results of a Quasi-Poisson model.

  • h_glm_negbin(): Helper function to return results of a negative binomial model.

  • h_glm_count(): Helper function to return the results of the selected model (Poisson, Quasi-Poisson, negative binomial).

  • h_ppmeans(): Helper function to return the estimated means.

See Also

summarize_glm_count


tern documentation built on June 22, 2024, 10:25 a.m.