Thanks for your reply, but I still couldn't solve the problem.

I am using the package statmod, and I need the AIC because I want to use the
step function (I am modelling many species, so I would prefer to do the
step automatically).
I can't find the tweedie  package in the R packages list and I don't know
how to download it from the package source available in
*http://cran.r-project.org/src/contrib/Descriptions/tweedie.html
* <http://cran.r-project.org/src/contrib/Descriptions/tweedie.html>.
However, after running the  tweedie.R file from that package source I am
able to use the dtweedie() function, but still I didn't figure out a way to
do the step (or to get the AIC from the glm command).

Thank you again for your help;

Catarina


On 13/08/07, Gordon Smyth <[EMAIL PROTECTED]> wrote:
>
> Dear Catarina,
>
> I prefer to leave the AIC value as NA for the tweedie GLM family
> because it takes extra time to compute and is only occasionally
> wanted. It's easy to compute the AIC yourself using the dtweedie()
> function of the tweedie package.
>
> Best wishes
> Gordon
>
> At 03:05 AM 14/08/2007, Catarina Miranda wrote:
> >Dear Gordon;
> >
> >I have also sent this email to R help mailing list, so I apologize
> >for duplicated mailing.
> >I am modelling densities of some species of birds, and I have a
> >problem with a great amount of zeros.
> >I have decided to try GLMs with the tweedie family, but in all the
> >models I have tried  I got an NA for the AIC value.
> >Just  to check the problem I've compared the a glm using the
> >Gaussian family with the identity link and a glm using the tweedie
> >family with var.power=0 and link.power=1. These are equal, as
> >expected, except the fact that the tweedie output gives me an NA for the
> AIC.
> >Could you help me with this problem?
> >Below you can find the two outputs I refer.
> >
> >Best Wishes;
> >
> >Catarina
> >
> > > summary(glm(formula=ACIN~DIST_REF+DIST_H2O+DIST_OST+
> > COTA+H2O_SUP+vasa,family=gaussian(link="identity")))
> >Call:glm(formula = ACIN ~ DIST_REF + DIST_H2O + DIST_OST + COTA
> >+     H2O_SUP + vasa, family = gaussian(link = "identity"))
> >Deviance
> >Residuals:       Min         1Q     Median         3Q        Max
> >-0.112792   -0.042860  -0.021113  -0.006311   1.551824
> >Coefficients:              Estimate Std. Error t value
> >Pr(>|t|)  (Intercept)
> >-6.625e-02  5.454e-02  -1.215   0.2256  DIST_REF     3.581e-06
> >1.336e-05   0.268   0.7889  DIST_H2O    -
> > 3.168e-05  1.527e-05  -2.074   0.0391
> >*DIST_OST    -1.799e-05  1.953e-05  -0.921   0.3579  COTA
> >5.648e-04  2.470e-04   2.287   0.0230
> >*H2O_SUP     -2.172e-04  3.994e-04  -0.544   0.5870  vasa
> >3.695e-02   4.573e-02    0.808   0.4199  ---Signif. codes:  0 '***'
> >0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
> >(Dispersion parameter for gaussian family taken to be 0.02151985)
> >     Null deviance: 5.6028   on 257  degrees of freedomResidual
> > deviance: 5.4015  on 251  degrees of freedomAIC: -249.33
> >Number of Fisher Scoring iterations: 2
> >
> >
> > > summary(glm(formula=ACIN~DIST_REF+DIST_H2O+DIST_OST+
> > COTA+H2O_SUP+vasa,control=
> > glm.control(maxit=750),family=tweedie(var.power=0, link.power=1)))
> >Call:glm(formula = ACIN ~ DIST_REF + DIST_H2O + DIST_OST + COTA
> >+     H2O_SUP + vasa, family = tweedie( var.power = 0, link.power =
> >1),     control = glm.control (maxit = 750))
> >Deviance
> >Residuals:       Min         1Q     Median         3Q        Max
> >-0.112792  -0.042860  -0.021113  -0.006311   1.551824
> >Coefficients:              Estimate Std. Error t value
> >Pr(>|t|)  (Intercept) -
> >6.625e-02  5.454e-02  -1.215   0.2256  DIST_REF     3.581e-06
> >1.336e-05   0.268   0.7889  DIST_H2O    -3.168e-05   1.527e-05
> >-2.074   0.0391
> >*DIST_OST    -1.799e-05  1.953e-05  -0.921   0.3579  COTA
> >5.648e-04  2.470e-04    2.287   0.0230
> >*H2O_SUP     -2.172e-04  3.994e-04  -0.544   0.5870  vasa
> >3.695e-02   4.573e-02   0.808   0.4199  ---Signif. codes:  0 '***'
> >0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
> >(Dispersion parameter for Tweedie family taken to be 0.02151985)
> >     Null deviance: 5.6028  on 257  degrees of freedomResidual
> > deviance: 5.4015  on 251  degrees of freedomAIC: NA
> >Number of Fisher Scoring iterations: 2
> >
> >
>
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to