[R-sig-eco] species richness, GLM and negative values
Bob O'Hara
bohara at senckenberg.de
Wed Oct 29 23:01:55 CET 2014
On 10/29/2014 04:27 PM, Ludovico Frate wrote:
> Dear all,I'am trying to fit a very simple linear model. I am analyzing the differences in the number of species (DS) found in several permanent plots in two year of observations.
> Firstly, I have calculated the differences per plot (i.e. number of species in Plot 1 in Time A - number of species in Plot 1 in Time B and so on for all the plots).Secondly, those differences were tested for deviation from zero by means of a linear model
> M2<-lm(DC~1, data = gransasso)summary(M2)E2<-residuals(M2)qqnorm(E2, pch = 19, col = "blue"); qqline(E2, col = "red")
> The qqnorm has shown that residuals were not normally distributed, thus I need to use a GLM. However GLM (poisson family) does not work with negative values (DS has negative values).I've tried to add a constant value to these differences (i.e. +100) but the result is misleading since I am testing for deviation from zero.
> Do you have any suggestions?
> Regards,Ludovico
Use the Poisson to model the number of species in each sample, so use
data like this:
Plot Time DS
1 A 4
1 B 7
2 A 0
2 B 1
3 A 23
3 B 7
...
Then you fit the model
Mgood <- glm(DS ~ Plot + Time, family=poisson())
where Plot and Time are factors (use Plot <- factor(Plot), for example,
if you need to).
You're interested in the Time effect, which is the average difference
between the numbers of species in the plots in the different times. The
Plot effect controls for different plots having different numbers of
species overall. If you look at summary(Mgood), the Time effect is the
log of the ratio of the species richnesses in times A and B. It will be
written as TimeB, which means it's log(E.B/E.A) (where E.A and E.B are
the expected species richnesses at times A and B). So, for example, an
estimate of 0.4 would mean that at Time B there are exp(0.4)=1.49 times
more species at time B than time A.
Bob
>
> Ludovico
> Frate
>
> PhD student (University of Molise - Italy)
> Environmetrics Lab
> http://www.distat.unimol.it/STAT/environmetrica/organico/collaboratori/ludovico-frate-1
> Department of Biosciences and Territory - DiBT
> Universit� del Molise.
> Contrada Fonte
> Lappone,
> 86090 - Pesche (IS)
> ITALIA.
> Cel: ++39
> 3333767557
> Fax: ++39 (0874) 404123
> E-mail ludovico.frate at unimol.it
> ludovicofrate at hotmail.it
>
> [[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
--
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
[[alternative HTML version deleted]]
More information about the R-sig-ecology
mailing list