Re: [R-sig-eco] quantifying directed dependence of environmental factors

2013-03-07 Thread Rich Shepard

On Thu, 7 Mar 2013, Philippi, Tom wrote:


I would look at packages bio.infer, paltran, fossil, and analogue, and
search to see if anyone has pushed them in the direction you want to go.


  bio.infer is based on the EPA's EMAP-West (Environmental Monitoring and
Analysis Program for the western states) and uses benthic macroinvertebrates
and fish with selected water chemistry parameters. It uses the ITIS
(International Taxonomic Identification System) to provide consistency in
naming taxa to the lowest reasonable level.

  Conceptually, one could assemble equivalent dataframes for diatom taxa and
environmental conditions, but I don't know if ITIS has plants/algae in the
system; problably does. However, the biota-environments relationships would
be based on current conditions and whether this would be valid for sediment
core data would need to be judged by a limnologist, not a stream ecologist
like me.

Rich

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


Re: [R-sig-eco] quantifying directed dependence of environmental factors

2013-03-07 Thread Jay Kerns
Hello,

On Thu, Mar 7, 2013 at 2:20 PM, Sarah Goslee  wrote:
> Hi,
>
>> I'm not sure how one would combine SEM / graphical models with compositional
>> dissimilarity as a response.  You might be able to fit a series of models in
>> adonis() or capscale(), comparing just direct factors to direct +
>> intermediate, etc..  I don't have any good ideas on how you might test more
>> complex causal structures.
>


Tom: thanks for chiming in.  If I understand you correctly, your idea
is similar to my colleague's first thought: he was asking about a sort
of nested ANOVA/model approach (he didn't call it that, but that was
what he was getting at).


> There's a fair bit of literature on Mantel-based path analysis, and
> other similar dissimilarity-based approaches. SEM can be used with
> composition as well, although not (I think) with the intermediate step
> of calculating dissimilarities.
>
> Besides journal articles employing those techniques, I like both of these:
>
> J. B. Grace, Structural Equation Modeling and Natural Systems,
> Cambridge University Press, Cambridge, UK, 2006.
>
> B. Shipley, Cause and Correlation in Biology: A User’s Guide to Path
> Analysis, Structural Equations and Causal Inference, Cambridge
> University Press, Cambridge, UK, 2000.
>


Sarah:  thank you again!  I will definitely check these out.


>> Given that you are dealing with diatoms across space (with environmental
>> measurements) and down time (in cores, often without environmental
>> measures), there may be an alternate approach possible based on calibration
>> approaches to inferred environments (e.g., WACAL) or modern analogs.  I
>> would look at packages bio.infer, paltran, fossil, and analogue, and search
>> to see if anyone has pushed them in the direction you want to go.
>>

Tom: many, many thanks.  I have not used any of those packages before.
 I will investigate every single one.

Jay

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


Re: [R-sig-eco] quantifying directed dependence of environmental factors

2013-03-07 Thread Sarah Goslee
Hi,

> I'm not sure how one would combine SEM / graphical models with compositional
> dissimilarity as a response.  You might be able to fit a series of models in
> adonis() or capscale(), comparing just direct factors to direct +
> intermediate, etc..  I don't have any good ideas on how you might test more
> complex causal structures.

There's a fair bit of literature on Mantel-based path analysis, and
other similar dissimilarity-based approaches. SEM can be used with
composition as well, although not (I think) with the intermediate step
of calculating dissimilarities.

Besides journal articles employing those techniques, I like both of these:

J. B. Grace, Structural Equation Modeling and Natural Systems,
Cambridge University Press, Cambridge, UK, 2006.

B. Shipley, Cause and Correlation in Biology: A User’s Guide to Path
Analysis, Structural Equations and Causal Inference, Cambridge
University Press, Cambridge, UK, 2000.

Sarah

> Given that you are dealing with diatoms across space (with environmental
> measurements) and down time (in cores, often without environmental
> measures), there may be an alternate approach possible based on calibration
> approaches to inferred environments (e.g., WACAL) or modern analogs.  I
> would look at packages bio.infer, paltran, fossil, and analogue, and search
> to see if anyone has pushed them in the direction you want to go.
>
> Tom
>
>
>
> On Thu, Mar 7, 2013 at 6:50 AM, Jay Kerns  wrote:
>>
>> Dear Sarah,
>>
>> On Thu, Mar 7, 2013 at 9:32 AM, Sarah Goslee 
>> wrote:
>> > That sounds like a job for path analysis or for structural equation
>> > modeling, depending on the level of sophistication desired and the
>> > hypotheses to be tested.
>> >
>>
>> *Yes!*  I said almost the exact same thing (I didn't say anything
>> about Path Analysis because I don't know much about it), but I had it
>> in my mind that SEM was targeted more to sociological things and
>> didn't know if/that it was common in ecological contexts.  Anyway,
>> it's nice to hear that word coming from somebody else.
>>
>> > There are plenty of good resources for both, in and out of R.
>>
>> Indeed.  I have some work to do.  Thank you.
>>
>> --
>> Jay
>>
>>

--
Sarah Goslee
http://www.functionaldiversity.org

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


Re: [R-sig-eco] quantifying directed dependence of environmental factors

2013-03-07 Thread Philippi, Tom
Jay--

I'm not sure how one would combine SEM / graphical models with
compositional dissimilarity as a response.  You might be able to fit a
series of models in adonis() or capscale(), comparing just direct factors
to direct + intermediate, etc..  I don't have any good ideas on how you
might test more complex causal structures.

Given that you are dealing with diatoms across space (with environmental
measurements) and down time (in cores, often without environmental
measures), there may be an alternate approach possible based on calibration
approaches to inferred environments (e.g., WACAL) or modern analogs.  I
would look at packages bio.infer, paltran, fossil, and analogue, and search
to see if anyone has pushed them in the direction you want to go.

Tom



On Thu, Mar 7, 2013 at 6:50 AM, Jay Kerns  wrote:

> Dear Sarah,
>
> On Thu, Mar 7, 2013 at 9:32 AM, Sarah Goslee 
> wrote:
> > That sounds like a job for path analysis or for structural equation
> > modeling, depending on the level of sophistication desired and the
> > hypotheses to be tested.
> >
>
> *Yes!*  I said almost the exact same thing (I didn't say anything
> about Path Analysis because I don't know much about it), but I had it
> in my mind that SEM was targeted more to sociological things and
> didn't know if/that it was common in ecological contexts.  Anyway,
> it's nice to hear that word coming from somebody else.
>
> > There are plenty of good resources for both, in and out of R.
>
> Indeed.  I have some work to do.  Thank you.
>
> --
> Jay
>
>
>
> > Sarah
> >
> >
> > On Wednesday, March 6, 2013, Jay Kerns wrote:
> >>
> >> Hello,
> >>
>
> ___
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>



-- 
---
Tom Philippi, Ph.D.
Quantitative Ecologist & Data Therapist
Inventory and Monitoring Program
National Park Service
(619) 523-4576
tom_phili...@nps.gov
http://science.nature.nps.gov/im/monitor

[[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] ordipointlabel for triplots

2013-03-07 Thread carolina monmany
It worked perfectly.

Thanks, Gavin.


2013/3/7 Gavin Simpson 

> On Thu, 2013-03-07 at 10:48 -0400, carolina monmany wrote:
> > Hi all,
> >
> >
> > I would like to use ordipointlabel() to plot a RDA but the function
> > only displays species and sites. How can I include environmental
> > variables as vectors?
> >
> >
> > Thanks!
>
> You can use
>
> text(ord, display = "bp")
>
> (where `ord` is your fitted RDA object) before or after the
> ordipointlabel() call to add the vectors with labels.
>
> HTH
>
> Gavin
>
>
>


-- 
---
A. CAROLINA MONMANY
Universidad de Puerto Rico
Departamento de Biologia - CN 235
POBOX 23360
San Juan, Puerto Rico 00931-3360
Tel: +1 787 764  x2847
Fax: +1 787 764 2610

[[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] nMDS plot with points of different size

2013-03-07 Thread Gavin Simpson
On Thu, 2013-03-07 at 15:37 +, Mark Fulton wrote:
> There's probably something "off the shelf", but
> I use a little function written in R:
> 
> #A function for doing an xyz bubbleplot.
> bubbleplot <- function(x, y, z, bmax=4, bmin=.5) {
>   plot(x,y, type="n")
>   z <- z-min(z); z <- z/max(z)
>   for (i in 1:length(x)) {
> points(x[i],y[i],cex=bmin+(bmax-bmin)*z[i])
>   }
> }

`points()` is vectorised and can take numeric vectors for relevant
arguments. Hence you don't need the `for()` loop here. Just generate the
vector of cex values you want and pass the whole thing plus all
coordinates to `points()`:

cex <- bmin+(bmax-bmin)*z
points(x, y, cex = cex)

should be sufficient.

HTH

G

> This just makes an empty plot, and draws circles in it
> scaled to values in "z".  You'll need to extract the axis 
> scores from the NMDS output to use this.  Tweak
> other graphics parameters as needed to get what you
> want.
> 
> Dr. Mark Fulton
> Professor of Biology
> Bemidji State University
> Bemidji, MN   56601
> http://faculty.bemidjistate.edu/mfulton/
> 
> 
> -Original Message-
> From: r-sig-ecology-boun...@r-project.org 
> [mailto:r-sig-ecology-boun...@r-project.org] On Behalf Of Stas Malavin
> Sent: Thursday, March 07, 2013 12:07 AM
> To: r-sig-ecology@r-project.org
> Subject: [R-sig-eco] nMDS plot with points of different size
> 
> Dear list members,
> 
> I want to plot an nMDS diagram with points' area proportional to the 
> abundance of particular species. I could imagine just plotting with type = 
> "n" and then using points() with different cex, but may be some special 
> functions/packages exist for that which you can point me to?
> 
> Thank you,
> Stas
> 
> 
> 
> Junior Res Asst
> Hydrobiology Lab
> Institute of Limnology
> Russian Academy of Sciences
> 
> Sevastyanova 9
> 196105 Russia, St Petersburg
> http://www.limno.org.ru
> Phone: +7 (812) 387-80-60
> Fax: +7 (812) 388-73-27
> 
>   [[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] ordipointlabel for triplots

2013-03-07 Thread Gavin Simpson
On Thu, 2013-03-07 at 10:48 -0400, carolina monmany wrote:
> Hi all,
> 
> 
> I would like to use ordipointlabel() to plot a RDA but the function
> only displays species and sites. How can I include environmental
> variables as vectors?
> 
> 
> Thanks!

You can use

text(ord, display = "bp")

(where `ord` is your fitted RDA object) before or after the
ordipointlabel() call to add the vectors with labels.

HTH

Gavin

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


[R-sig-eco] R: GLM

2013-03-07 Thread Enrico Caprio
Hi Mahnaz,
First of all check whether you're using the right family error
distribution according to tour respinse varia le. If you use team
abundancea from counts you need to specify "family = poisson" in your
model.

Then AIC is used to select the best from a set of candidate models, it
is not useful to describe how well a model fits the data in an absolute
sense.

Hope it helps.
Best regards

Enrico

Inviata dal mio Dispositivo Mobile
Da: Mahnaz Rabbaniha
Inviato: 07/03/2013 16:25
A: r-sig-ecology
Oggetto: [R-sig-eco] GLM
Dear all

I want to find regression between fish larva abundance and some
abiotic factor ,i used this code:

glm(formula = mychto ~ po4 + No3 + Si + Tn)


result:
Deviance Residuals:
Min   1Q   Median   3Q  Max
-26.586  -18.262  -12.296   -2.949  226.229

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept)  67.421173.9781   0.9110.371
po4  -0.2887 1.6037  -0.1800.859
No3   0.9151 4.5261   0.2020.841
Si   -0.1145 0.4850  -0.2360.815
Tn   -1.1568 4.4818  -0.2580.798

(Dispersion parameter for gaussian family taken to be 2444.917)

Null deviance: 63156  on 29  degrees of freedom
Residual deviance: 61123  on 25  degrees of freedom
AIC: 325.72


my question is about the acceptable this AIC, or this result with
goodness of fit?

thanks
-- 
Mahnaz

___
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] GLM

2013-03-07 Thread Bob O'Hara

On 03/07/2013 04:24 PM, Mahnaz Rabbaniha wrote:

Dear all

I want to find regression between fish larva abundance and some
abiotic factor ,i used this code:

glm(formula = mychto ~ po4 + No3 + Si + Tn)


result:
Deviance Residuals:
 Min   1Q   Median   3Q  Max
-26.586  -18.262  -12.296   -2.949  226.229

Coefficients:
 Estimate Std. Error t value Pr(>|t|)
(Intercept)  67.421173.9781   0.9110.371
po4  -0.2887 1.6037  -0.1800.859
No3   0.9151 4.5261   0.2020.841
Si   -0.1145 0.4850  -0.2360.815
Tn   -1.1568 4.4818  -0.2580.798

(Dispersion parameter for gaussian family taken to be 2444.917)

 Null deviance: 63156  on 29  degrees of freedom
Residual deviance: 61123  on 25  degrees of freedom
AIC: 325.72


my question is about the acceptable this AIC, or this result with
goodness of fit?

thanks
AIC tells you nothing about goodness of fit, it is used to compare 
different models.


A better way to assess goodness of fit is to look at the data and the 
model. It's clear that you have very skewed data (look at the distances 
between the quartiles of the residuals), so a Gaussian model, which 
assumes the residuals are symmetric, is inappropriate. It might make 
more sense to use a Poisson distribution, although you will probably 
need to account for over-dispersion (there are a few ways of doing 
this). Also, once you've fitted a glm, you can use plot() to get some 
useful model-checking plots (e.g. residuals).


There is more advice in the links here: 
.


Bob

--
Bob O'Hara

Biodiversity and Climate Research Centre
Senckenberganlage 25
D-60325 Frankfurt am Main,
Germany

Tel: +49 69 7542 1863 /  +49 69 798 40226
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

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


Re: [R-sig-eco] nMDS plot with points of different size

2013-03-07 Thread Mark Fulton
There's probably something "off the shelf", but
I use a little function written in R:

#A function for doing an xyz bubbleplot.
bubbleplot <- function(x, y, z, bmax=4, bmin=.5) {
  plot(x,y, type="n")
  z <- z-min(z); z <- z/max(z)
  for (i in 1:length(x)) {
points(x[i],y[i],cex=bmin+(bmax-bmin)*z[i])
  }
}

This just makes an empty plot, and draws circles in it
scaled to values in "z".  You'll need to extract the axis 
scores from the NMDS output to use this.  Tweak
other graphics parameters as needed to get what you
want.

Dr. Mark Fulton
Professor of Biology
Bemidji State University
Bemidji, MN   56601
http://faculty.bemidjistate.edu/mfulton/


-Original Message-
From: r-sig-ecology-boun...@r-project.org 
[mailto:r-sig-ecology-boun...@r-project.org] On Behalf Of Stas Malavin
Sent: Thursday, March 07, 2013 12:07 AM
To: r-sig-ecology@r-project.org
Subject: [R-sig-eco] nMDS plot with points of different size

Dear list members,

I want to plot an nMDS diagram with points' area proportional to the abundance 
of particular species. I could imagine just plotting with type = "n" and then 
using points() with different cex, but may be some special functions/packages 
exist for that which you can point me to?

Thank you,
Stas



Junior Res Asst
Hydrobiology Lab
Institute of Limnology
Russian Academy of Sciences

Sevastyanova 9
196105 Russia, St Petersburg
http://www.limno.org.ru
Phone: +7 (812) 387-80-60
Fax: +7 (812) 388-73-27

[[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-eco] GLM

2013-03-07 Thread Mahnaz Rabbaniha
Dear all

I want to find regression between fish larva abundance and some
abiotic factor ,i used this code:

glm(formula = mychto ~ po4 + No3 + Si + Tn)


result:
Deviance Residuals:
Min   1Q   Median   3Q  Max
-26.586  -18.262  -12.296   -2.949  226.229

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept)  67.421173.9781   0.9110.371
po4  -0.2887 1.6037  -0.1800.859
No3   0.9151 4.5261   0.2020.841
Si   -0.1145 0.4850  -0.2360.815
Tn   -1.1568 4.4818  -0.2580.798

(Dispersion parameter for gaussian family taken to be 2444.917)

Null deviance: 63156  on 29  degrees of freedom
Residual deviance: 61123  on 25  degrees of freedom
AIC: 325.72


my question is about the acceptable this AIC, or this result with
goodness of fit?

thanks
-- 
Mahnaz

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


Re: [R-sig-eco] quantifying directed dependence of environmental factors

2013-03-07 Thread Jay Kerns
Dear Sarah,

On Thu, Mar 7, 2013 at 9:32 AM, Sarah Goslee  wrote:
> That sounds like a job for path analysis or for structural equation
> modeling, depending on the level of sophistication desired and the
> hypotheses to be tested.
>

*Yes!*  I said almost the exact same thing (I didn't say anything
about Path Analysis because I don't know much about it), but I had it
in my mind that SEM was targeted more to sociological things and
didn't know if/that it was common in ecological contexts.  Anyway,
it's nice to hear that word coming from somebody else.

> There are plenty of good resources for both, in and out of R.

Indeed.  I have some work to do.  Thank you.

-- 
Jay



> Sarah
>
>
> On Wednesday, March 6, 2013, Jay Kerns wrote:
>>
>> Hello,
>>

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


[R-sig-eco] ordipointlabel for triplots

2013-03-07 Thread carolina monmany
Hi all,


I would like to use ordipointlabel() to plot a RDA but the function
only displays species and sites. How can I include environmental
variables as vectors?


Thanks!
-- 
---
A. CAROLINA MONMANY
Universidad de Puerto Rico
Departamento de Biologia - CN 235
POBOX 23360
San Juan, Puerto Rico 00931-3360
Tel: +1 787 764  x2847
Fax: +1 787 764 2610

[[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] quantifying directed dependence of environmental factors

2013-03-07 Thread Sarah Goslee
That sounds like a job for path analysis or for structural equation
modeling, depending on the level of sophistication desired and the
hypotheses to be tested.

There are plenty of good resources for both, in and out of R.

Sarah

On Wednesday, March 6, 2013, Jay Kerns wrote:

> Hello,
>
> I'm posting to this list because I believe it's the best place to
> go.  My question is R related only inasmuch as all the work I've
> done so far has been with R and I expect any answers I get from
> here will lead me to more R work.
>
> I'm consulting with an ecologist and an engineer on a project
> related to a reservoir nearby.  They've collected data on diatoms
> in the reservoir via core samples; they have sections of data over
> the past 100yrs.  They are looking at the community structure
> plus other environmental factors over the same time period.
>
> We've done a ton of work already and there's no point trying to
> hash all of that out here.  Short story: we did an NMDS, it fits
> OK (stress 0.17), there are obvious clusters in the ordination
> which correspond to a-priori clusters from ecological
> considerations (and which match an independent cluster analysis),
> we're really quite pleased overall.  We checked for relationships
> with =envfit=, most environmental variables are *highly*
> significant, yet there are a couple which aren't significant at
> all.  Here comes my question:
>
> The ecologist pointed out to me that our environmental variables
> don't have equal status (ecologically speaking); some variables
> lead to others.  For instance, there are so-called ultimate
> factors (population, percentage farmland) which contribute to
> intermediate factors (suspended solids, total phosphorous) which
> in turn contribute to direct factors (AREA, pH,...) which then in
> turn contribute to diatom structure.
>
> We have measured data on all the above and several more.  The
> model we are fitting with =envfit= is symmetric in those n
> environmental variables, but the ecology of the situation isn't
> symmetric, it's a directed top-down kind of relationship.  He
> asked me, "How can we quantify that?  How can we demonstrate
> that?  Can we quantify/demonstrate that?"  I don't know.
>
> There are ecologists on this list: what am I looking for, here?
> What methods do ecologists use to answer this (or related)
> question(s)?  Feel free to direct me to papers, literature,
> textbooks, whatever.  I'm trying to help answer this question
> and (this not being my subject specialty) I'm at a bit of a loss.
>
> If there are relevant R packages/vignettes/manuals you can point
> me to, that'd be cool too.
>
> Thanks for reading all the way down to here.
>
> Jay
>
> P.S. If it hadn't been for the archives of this list containing
> lengthy and poignant answers to *several* questions I've had
> already then I couldn't even have made it this far.  Thank you!
>
>
>
>

-- 
Sarah Goslee
http://www.stringpage.com
http://www.sarahgoslee.com
http://www.functionaldiversity.org

[[alternative HTML version deleted]]

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