rating_factors1: Include reference group in regression output

View source: R/model_rating_factors.R

rating_factors1R Documentation

Include reference group in regression output

Description

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.

Usage

rating_factors1(
  model,
  model_data = NULL,
  exposure = NULL,
  colname = "estimate",
  exponentiate = TRUE,
  round_exposure = 0
)

Arguments

model

a single glm object produced by glm()

model_data

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

exposure

the name of the exposure column in model_data, default value is NULL

colname

the name of the output column, default value is "estimate"

exponentiate

logical indicating whether or not to exponentiate the coefficient estimates. Defaults to TRUE.

round_exposure

number of digits for exposure (default to 0)

Author(s)

Martin Haringa

Examples

MTPL2a <- MTPL2
MTPL2a$area <- as.factor(MTPL2a$area)
x <- glm(nclaims ~ area, offset = log(exposure), family = poisson(),
 data = MTPL2a)
rating_factors1(x)


insurancerating documentation built on Dec. 28, 2022, 2:53 a.m.