Extract coefficients in terms of the original levels of the coefficients rather than the coded variables.Use rating_factors() to compare the output obtained from two or more glm objects.
rating_factors1(
model,
model_data = NULL,
exposure = NULL,
colname = "estimate",
exponentiate = TRUE,
round_exposure = 0
)
a single glm object produced by glm()
data.frame used to create glm object, this should only be specified in case the exposure is desired in the output, default value is NULL
the name of the exposure column in model_data
,
default value is NULL
the name of the output column, default value is "estimate"
logical indicating whether or not to exponentiate the coefficient estimates. Defaults to TRUE.
number of digits for exposure (default to 0)
MTPL2a <- MTPL2
MTPL2a$area <- as.factor(MTPL2a$area)
x <- glm(nclaims ~ area, offset = log(exposure), family = poisson(),
data = MTPL2a)
rating_factors1(x)
#> risk_factor level estimate pvalues
#> 1 (Intercept) (Intercept) 0.07514927 **
#> 2 area 0 1.00000000
#> 3 area 1 1.82294511
#> 4 area 2 1.59316792
#> 5 area 3 1.96560801