\(n = 89\) sites, one covariate \(x_i =\) temperature, response variable \(y_i =\) abundance of Gadus morhua (morue)
## Longitude Depth Temperature Abundance
## 356 22.43 349 3.95 309
## 357 23.68 382 3.75 1041
## 358 24.90 294 3.45 218
## 359 25.88 304 3.65 77
## 363 28.12 384 3.35 13
## 364 29.10 344 3.65 196
\[ \{Y_i\}_{1 \leq i \leq n} \text{ iid:} \qquad Y_i \sim \pi \delta_0 + (1-\pi) \mathcal{P}(\lambda) \] with \[ \text{logit}(\pi) = \alpha_0, \quad \log(\lambda) = \beta_0. \] so \[ \theta = (\alpha_0, \beta_0) \] where
library(pscl)
fit1 <- zeroinfl(Abundance ~ 1, data=barents, dist="poisson")
summary(fit1)
##
## Call:
## zeroinfl(formula = Abundance ~ 1, data = barents, dist = "poisson")
##
## Pearson residuals:
## Min 1Q Median 3Q Max
## -0.6728 -0.6728 -0.6728 -0.6523 20.6823
##
## Count model coefficients (poisson with log link):
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 4.64679 0.01851 251.1 <2e-16 ***
##
## Zero-inflation model coefficients (binomial with logit link):
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.7787 0.2283 3.411 0.000647 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Number of iterations in BFGS optimization: 1
## Log-likelihood: -3181 on 2 Df
Covariate \(x =\) temperature:
\[ \{Y_i\}_{1 \leq i \leq n} \text{ indep.:} \qquad Y_i \sim \pi_i \delta_0 + (1-\pi_i) \mathcal{P}(\lambda_i) \] where \[ \text{logit}(\pi) = x_i^\intercal \alpha, \quad \log(\lambda) = x_i^\intercal \beta \] so \[ \theta = (\alpha, \beta) \] where
fit2 <- zeroinfl(Abundance ~ Temperature + Depth + Longitude, data=barents, dist="poisson")
summary(fit2)
##
## Call:
## zeroinfl(formula = Abundance ~ Temperature + Depth + Longitude, data = barents,
## dist = "poisson")
##
## Pearson residuals:
## Min 1Q Median 3Q Max
## -3.12119 -0.46639 -0.22674 -0.09757 11.45024
##
## Count model coefficients (poisson with log link):
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -5.5834618 0.4375076 -12.76 < 2e-16 ***
## Temperature 2.1133715 0.0648629 32.58 < 2e-16 ***
## Depth 0.0135006 0.0003618 37.32 < 2e-16 ***
## Longitude -0.0473484 0.0077496 -6.11 9.98e-10 ***
##
## Zero-inflation model coefficients (binomial with logit link):
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 4.156607 3.702302 1.123 0.262
## Temperature -1.747246 0.444732 -3.929 8.54e-05 ***
## Depth 0.008987 0.006158 1.459 0.144
## Longitude -0.102372 0.085148 -1.202 0.229
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Number of iterations in BFGS optimization: 13
## Log-likelihood: -896 on 8 Df
No covariate (\(\mathcal{L}_0\))
## 'log Lik.' -3181.302 (df=2)
Both covariates (\(\mathcal{L}_1\))
## 'log Lik.' -896.0075 (df=8)
Model comparison: \[ LRT = 2(\mathcal{L}_1 - \mathcal{L}_0) \underset{H_0}{\sim} \chi^2_{d_1 - d_0} \]
## LRT = 4570.588 pval = 0