fc.model.refit: Refit a model based on collapsed factors

Description Usage Arguments Value Examples

View source: R/fc_model_refit.R

Description

Refit a model based on collapsed factors

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
fc.model.refit(varia.list, merge.list, mod)

## S3 method for class 'glm'
fc.model.refit(varia.list, merge.list, mod)

## S3 method for class 'rxGlm'
fc.model.refit(varia.list, merge.list, mod)

## S3 method for class 'lm'
fc.model.refit(varia.list, merge.list, mod)

Arguments

varia.list

a vector of names of factors to be collapsed

merge.list

a list of graycodes, each corresponding to factor in the varia.list

mod

the model to be refitted

Value

A list with the elements

BIC

The BIC value of the refitted model

AIC

The AIC value of the refitted model

logLik

The log-likelihood of the refitted model

model

Details of the refitted model

Examples

1
2
3
4
5
6
7
8
9
data("sweden")
m1 <- glm(Claims ~ Kilometres+Zone+Bonus+Make, offset = log(Insured),
          data = sweden, family = "poisson")
m2 <- fc.model.refit(varia.list=c("Kilometres"),
                     merge.list=list(c(1,2,3,3,4)),
                     mod = m1)
m3 <- fc.model.refit(varia.list=c("Kilometres, Make"),
                     merge.list=list(c(1,2,3,4,5), c(1,2,3,4,5,6,7,8,8)),
                     mod = m1)

senhu/FCBMA documentation built on Aug. 6, 2019, 4:56 p.m.