Re: [R-sig-eco] slope for rarefaction curve

2015-05-11 Thread Jari Oksanen
Basic algebrra seems to lead to this function:

rarederatk - 
function (x, k)
{
   x - x[x0]
   J - sum(x)
   d - digamma(J-k+1) -digamma(J-x-k+1)
   g - lgamma(J-x+1) + lgamma(J-k+1) - lgamma(J-x-k+1)-lgamma(J+1)
   d - d*exp(g)
   sum(d[is.finite(d)])
}

Here 'x' must be a vector of species abundances for a single site, and 'k' the 
sample site at which the 
derivative is evaluate. Here a simple test that this seems to work (but please 
check):

library(vegan)
data(mite)
rarecurve(mite[1,]) # first sampling point
sum(rarecurve(mite[1,]) # 140, evaluate at 126 individuals
y - rarefy(mite[1,], 126) # 19.47011
b - rarederatk(mite[1,], 126) # derivetive 0.04032 (with warnings)
abline(y-126*b, b) # matches the rarecurve plot

Cheers, Jari Oksanen

From: R-sig-ecology r-sig-ecology-boun...@r-project.org on behalf of Zoltan 
Botta-Dukat botta-dukat.zol...@okologia.mta.hu
Sent: 11 May 2015 08:49
To: r-sig-ecology@r-project.org
Subject: Re: [R-sig-eco] slope for rarefaction curve

Dear Simone,

Function rarefy uses the function developed by Hurlbert, thus if you
need slope in a certain point (as your graph suggests) you can calculate
the derivative of this function. It is not an easy job, because
factorials should be derived. See cues here how it can be done:

http://math.stackexchange.com/questions/300526/derivative-of-a-factorial

If you need mean slope in an interval, simply calculate the difference
in the calculated values for the beginning and end of the interval, and
divide the difference by the length of the interval.

Zoltan

2015.05.10. 23:57 keltezéssel, Simone Ruzza írta:
 Dear all,

 apologies for the total beginner's question. I was wondering if anyone
 can give some advice on how to calculate the slope for the last 10% of
 the records of a rarefaction curve computed with rarefy from vegan.
 Here is a graphic representation of what I would like to do:

 https://dl.dropboxusercontent.com/u/33966347/figure.JPG

 I have seen that this has been done in a recent paper and I was
 wondering if anyone may have any code snippet to do that. Sorry, maybe
 this is something really obvious but I have not quite understood how
 to do it.

 thanks!

 Simone

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


--
Botta-Dukát Zoltán

Ökológiai és Botanikai Intézet
Magyar Tudományos Akadémia
Ökológiai Kutatóközpont

2163. Vácrátót, Alkotmány u. 2-4.
tel: +36 28 360122/157
fax: +36 28 360110
botta-dukat.zol...@okologia.mta.hu
www.okologia.mta.hu


Zoltán BOTTA-Dukát

Institute of Ecology and Botany
Hungarian Academy of Sciences
Centre for Ecological Research

H-2163 Vácrátót, Alkomány u. 2-4.
HUNGARY
Phone: +36 28 360122/157
Fax..: +36 28 360110
botta-dukat.zol...@okologia.mta.hu
www.okologia.mta.hu

___
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-eco] relate environmental parameters to OTU network

2015-05-11 Thread Bjorn Tytgat

Hi all,

I've made a network of OTUs using phyloseq. Now, I'd like to correlate 
environmental variables to the clusters I observed. Anybody here who has 
an idea on how to do this exactly? Perhaps there are multiple ways, or 
if it is possible using another package (network, sna, ...), please let 
me know.



Thanks in advance.

Kind regards,
Bjorn

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


[R-sig-eco] Course: Introduction to zero inflated models with R

2015-05-11 Thread Highland Statistics Ltd
Apologies for cross-posting


We would like to announce the following statistics course in Palm Cove, 
Australia.

Course: Introduction to zero inflated models with R
Location: Palm Cove, Australia
Date: 17-21 August 2015
Price:   550 GBP
Course website: http://www.highstat.com/statscourse.htm
Course flyer: 
http://www.highstat.com/Courses/Flyers/Flyer2015_08PalmCoveII.pdf


Keywords:
Zero inflated GLM (ZIP, ZINB, ZAP, ZANB). Zero inflated GLMMs with 
random effects. Bayesian statistics,
MCMC and JAGS. lme4, glmmADMB, JAGS. Overdispersion and solutions. 
Poisson, negative binomial,
gamma, lognormal and binomial distributions. Count data. Continuous data.


Kind regards,

Alain Zuur

-- 
Dr. Alain F. Zuur

First author of:
1. Beginner's Guide to GAMM with R (2014).
2. Beginner's Guide to GLM and GLMM with R (2013).
3. Beginner's Guide to GAM with R (2012).
4. Zero Inflated Models and GLMM with R (2012).
5. A Beginner's Guide to R (2009).
6. Mixed effects models and extensions in ecology with R (2009).
7. Analysing Ecological Data (2007).

Highland Statistics Ltd.
9 St Clair Wynd
UK - AB41 6DZ Newburgh
Tel:   0044 1358 788177
Email: highs...@highstat.com
URL:   www.highstat.com


[[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] relate environmental parameters to OTU network

2015-05-11 Thread Johannes Björk
Hi Bjorn,

You could check out Local Similarity Analysis (http://meta.usc.edu/softs/lsa/) 
or alternatively, network assortativity e.g. in {igraph} 
http://www.inside-r.org/packages/cran/igraph/docs/assortativity

Hope it helps,

Cheers,
Johannes


On May 11, 2015, at 4:40 PM, Bjorn Tytgat wrote:

 Hi all,
 
 I've made a network of OTUs using phyloseq. Now, I'd like to correlate 
 environmental variables to the clusters I observed. Anybody here who has an 
 idea on how to do this exactly? Perhaps there are multiple ways, or if it is 
 possible using another package (network, sna, ...), please let me know.
 
 
 Thanks in advance.
 
 Kind regards,
 Bjorn
 
 ___
 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