Description Usage Arguments Value Examples
View source: R/fc_model_refit.R
Refit a model based on collapsed factors
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)
|
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 |
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 |
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.