Helper functions that can be used to return the results of various Poisson models.
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)
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.
(string
)
single variable name that is passed by rtables
when requested
by a statistics function.
(data.frame
)
dataset that includes all the variables that are called in .var
and 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.
(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()
.
(character
)
a character value specifying the distribution
used in the regression (Poisson, Quasi-Poisson, negative binomial).
(glm.fit
)
fitted model object used to derive the mean rate estimates in each treatment 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.
(proportion
)
value used to derive the confidence interval for the rate.
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.
summarize_glm_count