Re: [R-sig-eco] Fitting a GLMM to a percent cover data with glmer or glmmTMB (Botta-Dukát Zoltán)

2018-12-04 Thread James Rodger
 Hi Vasco,

An approach called fractional outcome regression sounds like it might be
suitable. It is advocated for variables in the range 0 to 1 (and including
these endpoints)

regards,

James

Message: 1
Date: Thu, 29 Nov 2018 15:23:32 +0100
From: =?UTF-8?Q?Botta-Duk=c3=a1t_Zolt=c3=a1n?=
 
To: r-sig-ecology@r-project.org
Subject: Re: [R-sig-eco]  Fitting a GLMM to a percent cover data with
glmer or glmmTMB
Message-ID: 
Content-Type: text/plain; charset="iso-8859-2"; Format="flowed"

Hi,

I'm sure that binomial is unsuitable for relative cover. Binomial
distribution are defined as number of successes in independent trials. I
think this scheme cannot be applied to relative cover or visually
estimated cover. It is important because both number of trials and
probability of success influence mean and variance, thus both should
have a meaning that correspond to terms in this scheme.

Unfortunately, I have no experience with tweedie distribution. I am also
interested in experience of others! In theory an alternative would be
zero-inflated beta distribution (after rescaling percentage between zero
to one interval). Do some has an experience (including its availability
in R) with it?

Cheers

Zoltan

2018. 11. 28. 20:47 keltezéssel, Vasco Silva írta:
> Hi,
>
> I am trying to fit a GLMM on percent cover for each species using glmer:
>
>> str(cover)
> 'data.frame': 102 obs. of  114 variables:
> $ Plot : Factor w/ 10 levels "P1","P10","P2",..: 1 1 1 1 1 3 3 ...
> $ Sub.plot: Factor w/ 5 levels "S1","S2","S3",..: 1 2 3 4 5 1 2 ...
> $ Grazing : Factor w/ 2 levels "Fenced","Unfenced": 1 1 1 1 1 1 1  ...
> $ sp1 : int  0 0 0 1 0 0 1 ...
> $ sp2 : int  0 0 0 0 0 3 3 ...
> $ sp3 : int  0 1 0 0 1 3 3 ...
> $ sp4 : int  1 3 13 3 3 3 0 ...
> $ sp6 : int  0 0 0 0 0 0 0 ...
>   ...
> $ tot  : int  93 65 120 80 138 113 ...
>
> sp1.glmm <- glmer (cbind (sp1, tot- sp1) ~ Grazing + (1|Plot), data=cover,
> family=binomial (link ="logit"))
>
> However, I wonder if binomial distribution can be used (proportion of
> species cover from a total cover) or if I should  fitted the GLMM with
> glmmTMB (tweedie distribution)?
>
> I would greatly appreciate it if someone could help me.
>
> Cheers.
>
> Vasco Silva
>
>   [[alternative HTML version deleted]]
>
> ___
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Fitting a GLMM to a percent cover data with glmer or glmmTMB

2018-11-29 Thread Javier Atalah
Hi,

Have a look at the gamlss library that has three beta inflated families.

Cheers
Javier


-Original Message-
From: R-sig-ecology  On Behalf Of 
scott.fos...@data61.csiro.au
Sent: Friday, 30 November 2018 8:57 a.m.
To: r-sig-ecology@r-project.org
Subject: Re: [R-sig-eco] Fitting a GLMM to a percent cover data with glmer or 
glmmTMB

Hi,

I agree with Zoltan that bionimial is probably inappropriate, for the reasons 
he stated.

I'm not sure that Tweedie is your solution though -- it is defined for 
non-negative real numbers.
 Not just those between 0 and 100%.  Perhaps easiest to think of fish biomass 
caught in a net (can be zero, or more.

Tweedie might work though, if your percentages are typically nowhere near the 
100% boundary.  In this case, the upper end of the support is kind of 
immaterial...  You hope...

Does glmmTMB supply a beta distribution?  Zero-inflated beta?  The quantile 
regression idea might be useful too, as Brian suggested, but I'm not sure about 
random effects in that case.  Beta regression will also have problems with 
exactly 0% (or 100%) observations.

It seems, to me, that you might be forced to make a decision about what is 
'least wrong', rather than what is 'best'.

Scott

PS Vasco and Zoltan: Sorry for the reply earlier, the message to the list 
bounced (CSIRO has recently changed my email address).

On Thu, 2018-11-29 at 16:40 +, Vasco Silva wrote:
>
> Thanks Zoltan. Using the glmmTMB with tweedie is the option that I can
> now discern...
>
> Vasco
>
>
>
> Botta-Dukát Zoltán  escreveu no
> dia quinta, 29/11/2018 à(s) 14:33:
>
> >
> >
> > I have to correct myself :),  because an important point is missing
> > from this sentence:
> >
> > Binomial distribution are defined as number of successes in
> > independent trials.
> >
> > correctly:
> >
> > Binomial distribution are defined as number of successes in FIXED
> > NUMBER OF independent trials.
> >
> > Zoltan
> >
> > 2018. 11. 29. 15:23 keltezéssel, Botta-Dukát Zoltán írta:
> > >
> > >
> > > Hi,
> > >
> > > I'm sure that binomial is unsuitable for relative cover. Binomial
> > > distribution are defined as number of successes in independent trials.
> > > I think this scheme cannot be applied to relative cover or
> > > visually estimated cover. It is important because both number of
> > > trials and probability of success influence mean and variance,
> > > thus both should have a meaning that correspond to terms in this scheme.
> > >
> > > Unfortunately, I have no experience with tweedie distribution. I
> > > am also interested in experience of others! In theory an
> > > alternative would be zero-inflated beta distribution (after
> > > rescaling percentage between zero to one interval). Do some has an
> > > experience (including its availability in R) with it?
> > >
> > > Cheers
> > >
> > > Zoltan
> > >
> > > 2018. 11. 28. 20:47 keltezéssel, Vasco Silva írta:
> > > >
> > > >
> > > > Hi,
> > > >
> > > > I am trying to fit a GLMM on percent cover for each species using glmer:
> > > >
> > > > >
> > > > >
> > > > > str(cover)
> > > > 'data.frame': 102 obs. of  114 variables:
> > > > $ Plot : Factor w/ 10 levels "P1","P10","P2",..: 1 1 1 1 1 3 3 ...
> > > > $ Sub.plot: Factor w/ 5 levels "S1","S2","S3",..: 1 2 3 4 5 1 2 ...
> > > > $ Grazing : Factor w/ 2 levels "Fenced","Unfenced": 1 1 1 1 1 1 1  ...
> > > > $ sp1 : int  0 0 0 1 0 0 1 ...
> > > > $ sp2 : int  0 0 0 0 0 3 3 ...
> > > > $ sp3 : int  0 1 0 0 1 3 3 ...
> > > > $ sp4 : int  1 3 13 3 3 3 0 ...
> > > > $ sp6 : int  0 0 0 0 0 0 0 ...
> > > >   ...
> > > > $ tot  : int  93 65 120 80 138 113 ...
> > > >
> > > > sp1.glmm <- glmer (cbind (sp1, tot- sp1) ~ Grazing + (1|Plot),
> > > > data=cover, family=binomial (link ="logit"))
> > > >
> > > > However, I wonder if binomial distribution can be used
> > > > (proportion of species cover from a total cover) or if I should
> > > > fitted the GLMM with glmmTMB (tweedie distribution)?
> > > >
> > > > I would greatly appreciate it if someone could help me.
> > > >
> > > > Cheers.
> > > >
> > > > Vasco Silva
> > > >
> > > > [[alternative HTML version deleted]]
> > > >
> > > > ___
> > > > R-sig-ecology mailing list
> > > > R-sig-ecology@r-project.org
> > > > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
> > > ___
> > > R-sig-ecology mailing list
> > > R-sig-ecology@r-project.org
> > > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
> > ___
> > R-sig-ecology mailing list
> > R-sig-ecology@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
> >
> [[alternative HTML version deleted]]
>
> ___
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
--
Scott Foster
Research Scientist
Data61, CSIRO
E scott.fos...@data61.csiro.au T +61 3 6232 5178 Postal address: 

Re: [R-sig-eco] Fitting a GLMM to a percent cover data with glmer or glmmTMB

2018-11-29 Thread Scott.Foster
Hi,

I agree with Zoltan that bionimial is probably inappropriate, for the reasons 
he stated.

I'm not sure that Tweedie is your solution though -- it is defined for 
non-negative real numbers.
 Not just those between 0 and 100%.  Perhaps easiest to think of fish biomass 
caught in a net (can
be zero, or more.

Tweedie might work though, if your percentages are typically nowhere near the 
100% boundary.  In
this case, the upper end of the support is kind of immaterial...  You hope...

Does glmmTMB supply a beta distribution?  Zero-inflated beta?  The quantile 
regression idea might be
useful too, as Brian suggested, but I'm not sure about random effects in that 
case.  Beta regression
will also have problems with exactly 0% (or 100%) observations.

It seems, to me, that you might be forced to make a decision about what is 
'least wrong', rather
than what is 'best'.

Scott

PS Vasco and Zoltan: Sorry for the reply earlier, the message to the list 
bounced (CSIRO has
recently changed my email address).

On Thu, 2018-11-29 at 16:40 +, Vasco Silva wrote:
> 
> Thanks Zoltan. Using the glmmTMB with tweedie is the option that I can now
> discern...
> 
> Vasco
> 
> 
> 
> Botta-Dukát Zoltán  escreveu no dia
> quinta, 29/11/2018 à(s) 14:33:
> 
> > 
> > 
> > I have to correct myself :),  because an important point is missing from
> > this sentence:
> > 
> > Binomial distribution are defined as number of successes in independent
> > trials.
> > 
> > correctly:
> > 
> > Binomial distribution are defined as number of successes in FIXED NUMBER
> > OF independent trials.
> > 
> > Zoltan
> > 
> > 2018. 11. 29. 15:23 keltezéssel, Botta-Dukát Zoltán írta:
> > > 
> > > 
> > > Hi,
> > > 
> > > I'm sure that binomial is unsuitable for relative cover. Binomial
> > > distribution are defined as number of successes in independent trials.
> > > I think this scheme cannot be applied to relative cover or visually
> > > estimated cover. It is important because both number of trials and
> > > probability of success influence mean and variance, thus both should
> > > have a meaning that correspond to terms in this scheme.
> > > 
> > > Unfortunately, I have no experience with tweedie distribution. I am
> > > also interested in experience of others! In theory an alternative
> > > would be zero-inflated beta distribution (after rescaling percentage
> > > between zero to one interval). Do some has an experience (including
> > > its availability in R) with it?
> > > 
> > > Cheers
> > > 
> > > Zoltan
> > > 
> > > 2018. 11. 28. 20:47 keltezéssel, Vasco Silva írta:
> > > > 
> > > > 
> > > > Hi,
> > > > 
> > > > I am trying to fit a GLMM on percent cover for each species using glmer:
> > > > 
> > > > > 
> > > > > 
> > > > > str(cover)
> > > > 'data.frame': 102 obs. of  114 variables:
> > > > $ Plot : Factor w/ 10 levels "P1","P10","P2",..: 1 1 1 1 1 3 3 ...
> > > > $ Sub.plot: Factor w/ 5 levels "S1","S2","S3",..: 1 2 3 4 5 1 2 ...
> > > > $ Grazing : Factor w/ 2 levels "Fenced","Unfenced": 1 1 1 1 1 1 1  ...
> > > > $ sp1 : int  0 0 0 1 0 0 1 ...
> > > > $ sp2 : int  0 0 0 0 0 3 3 ...
> > > > $ sp3 : int  0 1 0 0 1 3 3 ...
> > > > $ sp4 : int  1 3 13 3 3 3 0 ...
> > > > $ sp6 : int  0 0 0 0 0 0 0 ...
> > > >   ...
> > > > $ tot  : int  93 65 120 80 138 113 ...
> > > > 
> > > > sp1.glmm <- glmer (cbind (sp1, tot- sp1) ~ Grazing + (1|Plot),
> > > > data=cover,
> > > > family=binomial (link ="logit"))
> > > > 
> > > > However, I wonder if binomial distribution can be used (proportion of
> > > > species cover from a total cover) or if I should  fitted the GLMM with
> > > > glmmTMB (tweedie distribution)?
> > > > 
> > > > I would greatly appreciate it if someone could help me.
> > > > 
> > > > Cheers.
> > > > 
> > > > Vasco Silva
> > > > 
> > > > [[alternative HTML version deleted]]
> > > > 
> > > > ___
> > > > R-sig-ecology mailing list
> > > > R-sig-ecology@r-project.org
> > > > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
> > > ___
> > > R-sig-ecology mailing list
> > > R-sig-ecology@r-project.org
> > > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
> > ___
> > R-sig-ecology mailing list
> > R-sig-ecology@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
> > 
>   [[alternative HTML version deleted]]
> 
> ___
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
-- 
Scott Foster
Research Scientist
Data61, CSIRO
E scott.fos...@data61.csiro.au T +61 3 6232 5178
Postal address: CSIRO
Marine Laboratories, GPO Box 1538, Hobart TAS 7001
Street Address:
CSIRO, Castray Esplanade, Hobart Tas 7001, Australia
___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Fitting a GLMM to a percent cover data with glmer or glmmTMB

2018-11-29 Thread Vasco Silva
Thanks Zoltan. Using the glmmTMB with tweedie is the option that I can now
discern...

Vasco



Botta-Dukát Zoltán  escreveu no dia
quinta, 29/11/2018 à(s) 14:33:

> I have to correct myself :),  because an important point is missing from
> this sentence:
>
> Binomial distribution are defined as number of successes in independent
> trials.
>
> correctly:
>
> Binomial distribution are defined as number of successes in FIXED NUMBER
> OF independent trials.
>
> Zoltan
>
> 2018. 11. 29. 15:23 keltezéssel, Botta-Dukát Zoltán írta:
> > Hi,
> >
> > I'm sure that binomial is unsuitable for relative cover. Binomial
> > distribution are defined as number of successes in independent trials.
> > I think this scheme cannot be applied to relative cover or visually
> > estimated cover. It is important because both number of trials and
> > probability of success influence mean and variance, thus both should
> > have a meaning that correspond to terms in this scheme.
> >
> > Unfortunately, I have no experience with tweedie distribution. I am
> > also interested in experience of others! In theory an alternative
> > would be zero-inflated beta distribution (after rescaling percentage
> > between zero to one interval). Do some has an experience (including
> > its availability in R) with it?
> >
> > Cheers
> >
> > Zoltan
> >
> > 2018. 11. 28. 20:47 keltezéssel, Vasco Silva írta:
> >> Hi,
> >>
> >> I am trying to fit a GLMM on percent cover for each species using glmer:
> >>
> >>> str(cover)
> >> 'data.frame': 102 obs. of  114 variables:
> >> $ Plot : Factor w/ 10 levels "P1","P10","P2",..: 1 1 1 1 1 3 3 ...
> >> $ Sub.plot: Factor w/ 5 levels "S1","S2","S3",..: 1 2 3 4 5 1 2 ...
> >> $ Grazing : Factor w/ 2 levels "Fenced","Unfenced": 1 1 1 1 1 1 1  ...
> >> $ sp1 : int  0 0 0 1 0 0 1 ...
> >> $ sp2 : int  0 0 0 0 0 3 3 ...
> >> $ sp3 : int  0 1 0 0 1 3 3 ...
> >> $ sp4 : int  1 3 13 3 3 3 0 ...
> >> $ sp6 : int  0 0 0 0 0 0 0 ...
> >>   ...
> >> $ tot  : int  93 65 120 80 138 113 ...
> >>
> >> sp1.glmm <- glmer (cbind (sp1, tot- sp1) ~ Grazing + (1|Plot),
> >> data=cover,
> >> family=binomial (link ="logit"))
> >>
> >> However, I wonder if binomial distribution can be used (proportion of
> >> species cover from a total cover) or if I should  fitted the GLMM with
> >> glmmTMB (tweedie distribution)?
> >>
> >> I would greatly appreciate it if someone could help me.
> >>
> >> Cheers.
> >>
> >> Vasco Silva
> >>
> >> [[alternative HTML version deleted]]
> >>
> >> ___
> >> R-sig-ecology mailing list
> >> R-sig-ecology@r-project.org
> >> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
> >
> > ___
> > R-sig-ecology mailing list
> > R-sig-ecology@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>
> ___
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Fitting a GLMM to a percent cover data with glmer or glmmTMB

2018-11-29 Thread Botta-Dukát Zoltán
I have to correct myself :),  because an important point is missing from 
this sentence:


Binomial distribution are defined as number of successes in independent 
trials.


correctly:

Binomial distribution are defined as number of successes in FIXED NUMBER 
OF independent trials.


Zoltan

2018. 11. 29. 15:23 keltezéssel, Botta-Dukát Zoltán írta:

Hi,

I'm sure that binomial is unsuitable for relative cover. Binomial 
distribution are defined as number of successes in independent trials. 
I think this scheme cannot be applied to relative cover or visually 
estimated cover. It is important because both number of trials and 
probability of success influence mean and variance, thus both should 
have a meaning that correspond to terms in this scheme.


Unfortunately, I have no experience with tweedie distribution. I am 
also interested in experience of others! In theory an alternative 
would be zero-inflated beta distribution (after rescaling percentage 
between zero to one interval). Do some has an experience (including 
its availability in R) with it?


Cheers

Zoltan

2018. 11. 28. 20:47 keltezéssel, Vasco Silva írta:

Hi,

I am trying to fit a GLMM on percent cover for each species using glmer:


str(cover)

'data.frame': 102 obs. of  114 variables:
$ Plot : Factor w/ 10 levels "P1","P10","P2",..: 1 1 1 1 1 3 3 ...
$ Sub.plot: Factor w/ 5 levels "S1","S2","S3",..: 1 2 3 4 5 1 2 ...
$ Grazing : Factor w/ 2 levels "Fenced","Unfenced": 1 1 1 1 1 1 1  ...
$ sp1 : int  0 0 0 1 0 0 1 ...
$ sp2 : int  0 0 0 0 0 3 3 ...
$ sp3 : int  0 1 0 0 1 3 3 ...
$ sp4 : int  1 3 13 3 3 3 0 ...
$ sp6 : int  0 0 0 0 0 0 0 ...
  ...
$ tot  : int  93 65 120 80 138 113 ...

sp1.glmm <- glmer (cbind (sp1, tot- sp1) ~ Grazing + (1|Plot), 
data=cover,

family=binomial (link ="logit"))

However, I wonder if binomial distribution can be used (proportion of
species cover from a total cover) or if I should  fitted the GLMM with
glmmTMB (tweedie distribution)?

I would greatly appreciate it if someone could help me.

Cheers.

Vasco Silva

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Fitting a GLMM to a percent cover data with glmer or glmmTMB

2018-11-29 Thread Botta-Dukát Zoltán

Hi,

I'm sure that binomial is unsuitable for relative cover. Binomial 
distribution are defined as number of successes in independent trials. I 
think this scheme cannot be applied to relative cover or visually 
estimated cover. It is important because both number of trials and 
probability of success influence mean and variance, thus both should 
have a meaning that correspond to terms in this scheme.


Unfortunately, I have no experience with tweedie distribution. I am also 
interested in experience of others! In theory an alternative would be 
zero-inflated beta distribution (after rescaling percentage between zero 
to one interval). Do some has an experience (including its availability 
in R) with it?


Cheers

Zoltan

2018. 11. 28. 20:47 keltezéssel, Vasco Silva írta:

Hi,

I am trying to fit a GLMM on percent cover for each species using glmer:


str(cover)

'data.frame': 102 obs. of  114 variables:
$ Plot : Factor w/ 10 levels "P1","P10","P2",..: 1 1 1 1 1 3 3 ...
$ Sub.plot: Factor w/ 5 levels "S1","S2","S3",..: 1 2 3 4 5 1 2 ...
$ Grazing : Factor w/ 2 levels "Fenced","Unfenced": 1 1 1 1 1 1 1  ...
$ sp1 : int  0 0 0 1 0 0 1 ...
$ sp2 : int  0 0 0 0 0 3 3 ...
$ sp3 : int  0 1 0 0 1 3 3 ...
$ sp4 : int  1 3 13 3 3 3 0 ...
$ sp6 : int  0 0 0 0 0 0 0 ...
  ...
$ tot  : int  93 65 120 80 138 113 ...

sp1.glmm <- glmer (cbind (sp1, tot- sp1) ~ Grazing + (1|Plot), data=cover,
family=binomial (link ="logit"))

However, I wonder if binomial distribution can be used (proportion of
species cover from a total cover) or if I should  fitted the GLMM with
glmmTMB (tweedie distribution)?

I would greatly appreciate it if someone could help me.

Cheers.

Vasco Silva

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology