Learn R Programming

insurancerating (version 0.5.2)

rating_factors: Include reference group in regression output

Description

This extracts coefficients in terms of the original levels of the coefficients rather than the coded variables.

Usage

rating_factors(model, colname = "estimate", exponentiate = TRUE)

Arguments

model

a (generalized) linear model fit

colname

name of column with estimates. Defaults to "estimate".

exponentiate

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

Value

data.frame

Details

This function is adopted from the dummy.coefstats function. Our adoption prints a data.frame as output. Categorical variables should be changed to factors in the data.frame used to fit the (generalized) linear model.

Examples

Run this code
# NOT RUN {
g1 <- glm(nclaims ~ age_policyholder, family = "poisson", data = MTPL)
rating_factors(g1)
# }

Run the code above in your browser using DataLab