Error distribution for fractional response
Hi again, Mollie, you are right (I should have checked) -- suggestions based on the binomial should not be considered as there may be more than 1 sapling per adult. Scott
On 31/01/14 01:48, Mollie Brooks wrote:
Dear Adhara,
I agree with Bob and Scott that transforming the data is probably not the best option.
I basically agree with Bob?s suggestion, except that his answer assumes you have a covariate and I don?t see one in your data.
Without a covariate, I would do the following
Let lambda be the expected number of seedlings E(S) for a given number of adults, A.
Let g be the number of saplings per adult.
E(S)=lambda= g*A
If you use a log link in either a poisson or negative binomial model, this gives you
log(lambda)=log(g*A)=log(g)+log(A)
You can fit this using an offset and an intercept. Then the intercept gives you an estimate of log(g). So to get the biologically meaningful
parameter(g) back, take the exponential.
ndat=50
maxad=10
g=.1
A=sample(1:maxad, ndat, replace=TRUE)
S=rpois(ndat, lambda=g*A)
dat=data.frame(S=S, A=A)
m1=glm(S~1, offset=log(A), family=poisson, data=dat)
g_est=exp(coef(m1))
If you want to do some model comparison, it?s best if they are all fit in the same package.
install.packages("glmmADMB",
repos=c("http://glmmadmb.r-forge.r-project.org/repos",
getOption("repos")),type="source")
library(glmmADMB)
pois1=glmmadmb(S~1+ offset(log(A)), family="poisson", data=dat)
nbin1=glmmadmb(S~1+ offset(log(A)), family="nbinom", data=dat)
zip1=glmmadmb(S~1+ offset(log(A)), family="poisson", data=dat, zeroInflation=TRUE)
library(bbmle) #forAICtab
AICtab(pois1, nbin1, zip1)
I would not use a binomial distribution as suggested below because it assumes you can only have one sapling per adult and I think I see at least one
instance in your data where S>A.
cheers,
Mollie
------------------------
Mollie Brooks, PhD
Postdoctoral Researcher, Population Ecology Research Group http://www.popecol.org <http://www.popecol.org>
Institute of Evolutionary Biology & Environmental Studies, University of Z?rich
On 30 Jan 2014, at 11:08 AM, Bob O'Hara <bohara at senckenberg.de> wrote:
On 30/01/14 10:58, Adhara Pardo wrote:
Dear R users, I would like to fit a GLM to some plant regeneration data (see bottom of this e-mail). The dependent variable, an index of regeneration, was obtained by diviving the number of saplings by the number of adults plants present in each plot. The result is a highly skewed variable and thus, specifying, for instance, a Gaussian distribution does not seem to be appropriate. Data transformation does not help either. Do you have any suggestion on the best distribution to choose?
Rather than use an index, it might be better to use the number of saplings directly, and assume they are Poisson distributed (or some form of
over-dispersed Poisson). You can use the log of the number of adults as an offset:
glm(saplings ~ something + offset(log(adults)) The model is saplings ~ Poisson(lambda) log(lambda) = alpha + beta*something + log(adults) where alpha and beta are the parameters being estimated (lambda is the expected number of saplings). This model is the same as lambda = adult*exp(alpha + beta*something) so it's equivalent to modelling saplings/adults: the adults have just been moved to the other side of the equation. Bob -- Bob O'Hara Biodiversity and Climate Research Centre Senckenberganlage 25 D-60325 Frankfurt am Main, Germany Tel: +49 69 7542 1863 Mobile: +49 1515 888 5440 WWW: http://www.bik-f.de/root/index.php?page_id=219 Blog: http://blogs.nature.com/boboh Journal of Negative Results - EEB: www.jnr-eeb.org <http://www.jnr-eeb.org>
_______________________________________________ R-sig-ecology mailing list R-sig-ecology at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
[[alternative HTML version deleted]]
_______________________________________________ R-sig-ecology mailing list R-sig-ecology at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Scott Foster Computational Informatics CSIRO E scott.foster at csiro.au T +61 3 6232 5178 Postal address: CSIRO Computational Informatics, GPO Box 1538, Hobart TAS 7001 Street Address: CSIRO Computational Informatics, Castray Esplanade, Hobart Tas 7001, Australia www.csiro.au