FLXMRziglm.RdThis is a driver which allows fitting of zero inflated poisson and binomial models.
FLXMRziglm(formula = . ~ ., family = c("binomial", "poisson"), ...)A formula which is interpreted relative to the formula
specified in the call to flexmix using
update.formula. Default is to use the original
flexmix model
formula.
A character string naming a glm
family function.
passed to FLXMRglm
Returns an object of class FLXMRziglm inheriting from FLXMRglm.
In fact this only approximates zero inflated models by fixing the coefficient of the intercept at -Inf and the other coefficients at zero for the first component.
data("dmft", package = "flexmix")
Model <- FLXMRziglm(family = "poisson")
Fitted <- flexmix(End ~ log(Begin + 0.5) + Gender + Ethnic + Treatment,
model = Model, k = 2 , data = dmft,
control = list(minprior = 0.01))
summary(refit(Fitted))
#> $Comp.2
#> Estimate Std. Error z value Pr(>|z|)
#> (Intercept) -0.1470647 0.0835622 -1.7599 0.0784175 .
#> log(Begin + 0.5) 0.7303431 0.0402251 18.1564 < 2.2e-16 ***
#> Gendermale 0.0068803 0.0543267 0.1266 0.8992203
#> Ethnicwhite 0.0500279 0.0592188 0.8448 0.3982235
#> Ethnicblack -0.0472583 0.0893044 -0.5292 0.5966790
#> Treatmenteduc -0.2371849 0.0796090 -2.9794 0.0028884 **
#> Treatmentall -0.3277740 0.0846497 -3.8721 0.0001079 ***
#> Treatmentenrich 0.0172644 0.0675526 0.2556 0.7982826
#> Treatmentrinse -0.2414629 0.0666651 -3.6220 0.0002923 ***
#> Treatmenthygiene -0.1026311 0.0694610 -1.4775 0.1395320
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>