Predicting the proportion of zeros
I am the author of the statmod package and joint author of the tweedie package. Everything in your example is working correctly. The code is accounting correctly for any zeros that might be in the data.
As Glen_b and Tim have explained, the predicted mean value will never be exactly zero, unless the probability of a zero is 100%. What might be of interest though is the predicted proportion of zeros, and this can easily be extracted from the model fit as I show below.
Here is a more sensible working example. First simulate some data:
> library(statmod)
> library(tweedie)
> x <- 1:100
> mutrue <- exp(-1+x/25)
> summary(mutrue)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.3829 1.0306 2.7737 5.0287 7.4644 20.0855
> y <- rtweedie(100, mu=mutrue, phi=1, power=1.3)
> summary(y)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.0000 0.8482 2.9249 4.7164 6.1522 24.3897
> sum(y==0)
[1] 12
The data contains 12 zeros.
Now fit a Tweedie glm:
> fit <- glm(y ~ x, family=tweedie(var.power=1.3, link.power=0))
> summary(fit)
Call:
glm(formula = y ~ x, family = tweedie(var.power = 1.3, link.power = 0))
Deviance Residuals:
Min 1Q Median 3Q Max
-2.71253 -0.94685 -0.07556 0.69089 1.84013
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.816784 0.168764 -4.84 4.84e-06 ***
x 0.036748 0.002275 16.15 < 2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for Tweedie family taken to be 0.8578628)
Null deviance: 363.26 on 99 degrees of freedom
Residual deviance: 103.70 on 98 degrees of freedom
AIC: NA
Number of Fisher Scoring iterations: 4
Of course the regression on x is highly significant. The estimated value of the dispersion ϕ is 0.85786.
The predicted proportion of zeros for each value of x can be computed from the following formula:
> Phi <- 0.85786
> Mu <- fitted(fit)
> Power <- 1.3
> Prob.Zero <- exp(-Mu^(2-Power) / Phi / (2-Power))
> Prob.Zero[1:5]
1 2 3 4 5
0.3811336 0.3716732 0.3622103 0.3527512 0.3433024
> Prob.Zero[96:100]
96 97 98 99 100
1.498569e-05 1.121936e-05 8.336499e-06 6.146648e-06 4.496188e-06
So the predicted proportion of zeros varies from 38.1% at the smallest mean values down to 4.5e-6 at the largest mean values.
The formula for the probability of an exact zero can be found in Dunn & Smyth (2001) Tweedie Family Densities: Methods of Evaluation or Dunn & Smyth (2005) Series evaluation of Tweedie exponential dispersion model densities.