[R-sig-eco] Continuous distribution for zero or positive values (inGLM or GLMM)
Ben Bolker
bbolker at gmail.com
Fri May 20 17:44:52 CEST 2011
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 05/19/2011 06:24 PM, Fred Takahashi wrote:
> Ben and Ruben, thank you very much for the suggestions. I started
> the “homework” and I had the impression that I can forget to find a
> GLMM implementation with Tweedie distribution (in a preliminar GLM,
> this distribution produced a very decent fit...).
You can actually fit a glmm with the 'tweedie' family in glmmPQL:
library(tweedie)
library(MASS)
library(nlme)
set.seed(1001)
nblock <- 20
nperblock <- 50
ntot <- nblock*nperblock
d <-
data.frame(x=runif(ntot),f=factor(rep(LETTERS[1:nblock],each=nperblock)))
u <- rnorm(nblock,sd=1)
d <- within(d,
{
eta <- 1+4*x+u[f]
mu <- exp(eta)
y <- rtweedie(ntot,power=1.5,mu=mu,phi=2)
})
sum(d$y==0)
hist(log(d$y[d$y>0]))
gg <-
glmmPQL(y~x,random=~1|f,data=d,family=tweedie(var.power=1,link.power=0))
====
However, you would probably want to do this in a loop if you want to
estimate var.power as well. Unfortunately, glmmPQL makes it very hard
to extract the analogues of logLik() or AIC() which you would want to
use to evaluate the best-fitting var.power
However the
> two-part analysis looks a good option. About the transformation of
> continous data to discret (to fit a poisson distribution), wouldn't
> include some subjectivity in the analysis (once the "size of
> container" of the Ruben example need to be choosed)?
>
Yes.
cheers
Ben
> Regards Fred
>
>
> 2011/5/19 Rubén Roa <rroa at azti.es>:
>> This is a well known modeling issue and several approaches are
>> available.
>>
>> We have tried the Delta approach with good results. This is
>> essentially a binomial glm for the presence-absence representation
>> of the data, and conditional on the Bernoulli variable being 1, a
>> regular continuous distribution such as Gamma glm for the positive
>> values. Option 3) in Ben Bolker's list.
>>
>> See
>>
>> Aitchison, J. 1955. On the distribution of a positive random
>> variable having a discrete probability mass at the origin. Journal
>> of American Statistical Association 50, 901-908
>>
>> Pennington, M. 1983. Efficient estimators of abundance, for fish
>> and plankton surveys. Biometrics 39, 281-286
>>
>> Another option is to transform your continuous response into
>> counts. For example, if you have 0.745 kg of grass from one plot,
>> how many stahdard 100 ml containers can you fill in a standardized
>> manner with that? That's a count. Now if you turn your grass
>> biomass into counts and if you are lucky (not excessive number of
>> zeroes) then maybe a Poisson glm will be good. And the Poisson does
>> not bug you with nuisance parameters ...
>>
>> We tried several things like that, and also the Tweedie
>> distribution (number 4) in Ben Bolker's list) in this paper:
>>
>> Tascheri, R., Saavedra-Nievas, J.C., Roa-Ureta, R. 2010.
>> Statistical models to standardize catch rates in the multi-species
>> trawl fishery for Patagonian grenadier (Macruronus magellanicus) off
>> Southern Chile. Fisheries Research 105: 200–214
>>
>> Adding a constant to the zeroes is just not right (see p. 324 of
>> the below quoted article for an authoritative sentence on this
>> matter):
>>
>> Venables, W.N., Dichmont, C.M. 20004. GLMs, GAMs and GLMMs: an
>> overview of theory for applications in fisheries research. Fisheries
>> Research 70: 319–337.
>>
>> HTH
>>
>> Rubén
>>
>> ____________________________________________________________________________________
>>
>>
>>
Dr. Rubén Roa-Ureta
>> AZTI - Tecnalia / Marine Research Unit Txatxarramendi Ugartea z/g
>> 48395 Sukarrieta (Bizkaia) SPAIN
>>
>>
>>
>
> _______________________________________________ R-sig-ecology mailing
> list R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk3WjHMACgkQc5UpGjwzenMCbgCginIDtuMyNVkLp5aWXOfj7JOC
cMIAnRM5yBq/FuirmDWOjQtAGrEZY6JJ
=34X/
-----END PGP SIGNATURE-----
More information about the R-sig-ecology
mailing list