[R-sig-eco] clamping in R dismo package

2012-12-05 Thread Pascal Title
Hi all,

In niche modeling with maxent through the R package Dismo, is there a way
to see which areas in a projected model were subjected to clamping?

I know there's an option in maxent to write clamp grid, but using that
argument in the predict function in Dismo doesn't seem to do anything...

Thanks,
-Pascal


-- 
Pascal Title, MSc.
PhD student, Rabosky Lab http://cteg.berkeley.edu/~rabosky/Home.html
Dept of Ecology and Evolutionary Biology
University of Michigan
pti...@umich.edu

[[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-eco] Permanova with nested data

2012-12-05 Thread Beth Atkinson

Hi,

Apologies if this has been asked before, I looked looked through the 
archives and couldn't find a solution.



I have plant community data from 32 woodland plots. Plots are grouped into 
sites (8 sites in total). Half the sites (4) are on one soil type, and half 
on another. At each site there are 4 plots, each under a different 
management regime .  I want to know if the plant communities under 
different management regimes and on different soil types differ.


My data is as follows:


veg - a data frame containg the community data (abundances of each species 
at each plot)



environ-read.csv(file.choose(),header=TRUE)


str(environ)

'data.frame':   32 obs. of  4 variables:
$ code: Factor w/ 32 levels cf.1,cf.3,..: 1 9 17 25 2 10 18 26 3 11 ...
$ site: Factor w/ 8 levels eight,five,..: 5 5 5 5 8 8 8 8 3 3 ...
$ type: Factor w/ 4 levels clearfell,plantation,..: 1 2 3 4 1 2 3 4 1 
2 ...

$ nvc : Factor w/ 2 levels W10,W8: 2 2 2 2 2 2 2 2 1 1 ...

# site is the name of each site
# type refers to the management regime
# nvc refers to the soil type (actually the NVC classification)

Prior to PERMANOVA I used betadisper() to test for homogeneity of 
multivariate dispersion.  No difference in dispersion was found either 
between plots on different site types, or plots on different NVC types.



I carried out a PERMANOVA using adonis on this data as follows:

adon.mod1.bray-adonis(veg~ type*nvc, data=environ,strata=environ$site,
method = bray, permutations=999)

I used strata=environ$site as management regime is nested within site.


adon.mod1.bray


Call:
adonis(formula = veg ~ type * nvc, data = environ, permutations = 999,
 method = bray, strata = environ$site)

Terms added sequentially (first to last)

 Df SumsOfSqs MeanSqs F.Model  R2 Pr(F)
type   32.2358 0.74528  3.5742 0.24662  0.001 ***
nvc11.0905 1.09045  5.2296 0.12028  0.001 ***
type:nvc   30.7353 0.24509  1.1754 0.08110  0.208
Residuals 245.0044 0.20852 0.55200
Total 319.0659 1.0


Is this acceptable. Is the strata=environ$site part correct?

If data points are only being permutted within sites, and each site only 
occurs on one soil type, is there no permutation between NVC/soil types?


I've also heard that adonis does not give the correct p values when data is 
nested. Is this correct, and a problem in the above example? If so is there 
a more suitable analysis? Would a db-RDA as follows be ok?:



dbRDA-capscale(veg~type*nvc+Condition(site), data=environ, 
distance=bray, add=TRUE)


anova.cca(dbRDA, stop=999)

anova.cca(dbRDA, by=terms, step=999)


anova.cca(dbRDA, by=terms, step=999)

Permutation test for capscale under reduced model
Terms added sequentially (first to last)

Model: capscale(formula = veg ~ type + nvc + Condition(site) + type:nvc, 
data = environ, distance = bray, add = TRUE)

DfVar  F N.Perm Pr(F)
type  3 2.9615 3.3215999 2e-16 ***
type:nvc  3 1.1299 1.2673999 0.1141
Residual 18 5.3496


However, this doesn't show a result for nvc. Why?

I've also been looking into the manyglm() function in mvabund, but I don't 
think this can accept random effects.


Any help would be greatly appreciated,

Thanks,

Beth


Beth Atkinson

PhD student
Community Ecology Group
School of Biological Sciences
University of Bristol
Woodland Road
Bristol
BS8 1UG

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


[R-sig-eco] Vegan metaMDS: unusual first run stress values with large data set

2012-12-05 Thread Ewan Isherwood
Hello, R-Community! This is the first time writing to this group and
indeed the first time using a mailing list, so please bear with me if
I’ve done something wrong.

I have a large species x site matrix (89 x 4831) that I want to
ordinate using metaMDS in the Vegan (2.0-5) package in R (2.15.2). If
I run this data frame using the Jaccard index in two or more
dimensions (k1), the first run (run=0) has a relatively low stress
value and the other 20 runs are much higher and have very low
deviation. However, k=1 seems to work fine. Furthermore, a
stress/scree plot reveals a pyramid-like shape, where the k=1 lowest
stress value is low, increases rapidly for k=2 then decreases slowly
as k increases.

Dimensions  Stress
1   0.1382185
2   0.1939509
3   0.1695375
4   0.155221
5   0.1406408
6   0.1294149

I’ve tried this with a small iteration of this data and this issue
arises at k2 rather than at k1 as it is here. Anyway, this is the
input and output:

library(vegan)
library(MASS)
PSU - read.table(PSU.txt, header = TRUE, sep = )
PSU.sp - PSU[, 22:110]
PSU.NMDS - metaMDS(PSU.sp, k=4, zerodist = add, distance = jaccard)

Square root transformation
Wisconsin double standardization
Zero dissimilarities changed into  0.0006657301
Run 0 stress 0.155221
Run 1 stress 0.2548103
Run 2 stress 0.255434
Run 3 stress 0.2551382
… (Up to run 20 where run 1 through run 20 have all very similar stress values.)

Call:
metaMDS(comm = PSU.sp, distance = jaccard, k = 4, zerodist = add)

global Multidimensional Scaling using monoMDS

Data: wisconsin(sqrt(PSU.sp))
Distance: jaccard

Dimensions: 4
Stress: 0.155221
Stress type 1, weak ties
No convergent solutions - best solution after 20 tries
Scaling: centring, PC rotation, halfchange scaling
Species: expanded scores based on ‘wisconsin(sqrt(PSU.sp))’

Now, again, with k=1 this does not happen – the solution looks like
any other regular NMDS run. There are no blank values in the data as
they are all numbers between 0 and 100 corresponding to % cover, and
every row and column sum is greater than 0. There are many sites with
the same species configurations, hence the zerodist, but omitting this
makes no difference to the problem at hand. The NMDS works fine if I
use a subset of the data, but I have not subsetted and tested all of
it. Other metric (Euclidean) and nonmetric (Bray) dissimilarity
indices result in the same effect. I’ve chosen k=4 here because of the
(marginal) elbow in the stress plot, but the data itself actually
looks pretty good at any k value. Even though the output is
reasonable, I am concerned that hitting the best solution by a large
amount on the first run means something is messing up, and this
concern is amplified by the strange pyramid shaped stress plot.
Because metaMDS uses random starts, I don't see how this output is
possible. I've scoured the help files and archives of this list and I
am really now at a loss to explain this.

Thank you in advance for your time and consideration!

Ewan

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


[R-sig-eco] Applied Environmental Data Analyses: Water Chemistry and Biota

2012-12-05 Thread Rich Shepard

  I left academia and basic ecological research decades ago and now work
with environmental data collected by companies in compliance with regulatory
permit requirements. I've bought and read (mostly) all the books I could
find on ecological analyses using R (all but one of Alain Zuur's books,
Legendre  Legendre's 2nd English edition, Mike McCarthy's Bayesian methods
book, and Ben Bolker's book) but cannot find any references to 'communities'
in the indices. I'd greatly appreciate pointers to sources appropriate for
environmental data (which is much sloppier than ecological research data).

  The last time I addressed community analyses was my post-doc research
which I published in Freshwater Biology in 1984. Only within the past year
have my clients needed to address issues using benthic macroinvertebrate
assemblages (and fish) in streams. And, since I work by myself, I've no one
with whom to share ideas and discuss approaches; perhaps there's a better
forum than this mail list for this.

  The available benthic data has little taxonomic consistency below the
family level. I want to use functional feeding groups rather than taxa as
the basis of comparison because those better reflect conditions in each
stream (collections of biota are made only once per year), and I want to
examine correlations and cause-and-effect relations between biotic
assemblages and water chemistry. There are only a few fish collections,
tool, in the available data.

  All ideas are certainly welcome!

TIA,

Rich

--
Richard B. Shepard, Ph.D.  |   Integrity - Credibility - Innovation
Applied Ecosystem Services, Inc.   |
http://www.appl-ecosys.com Voice: 503-667-4517  Fax: 503-667-8863

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


Re: [R-sig-eco] Applied Environmental Data Analyses: Water Chemistry and Biota

2012-12-05 Thread Alan Haynes
Hi Rich,

Theres a book coming out next May by Otto Wildi called Data Analysis in
Vegetation Ecology 2nd Edition which includes a lot of R code. While its
aimed at vegetation ecology, a lot of the principles in the book can be
generalised to community analysis in whatever form. It covers ordination,
cluster analysis, some basic GLM and numerous other topics.

It takes the topics in the 1st Ed and adds R code to redo the analyses, and
adds a few other methods not covered in the 1st Ed, the main difference
will be the code though.

Book:
http://eu.wiley.com/WileyCDA/Section/id-302479.html?query=Otto+Wildi

1st Ed website:
http://www.wsl.ch/info/mitarbeitende/wildi/data_analysis_book/index_EN

HTH

Alan


--
Email: aghay...@gmail.com
Mobile: +41794385586
Skype: aghaynes



On 6 December 2012 04:59, alfredo tello alfredote...@gmail.com wrote:

 Hi Rich,

 Check out the R package Vegan tutorial by Jari Oksanen:
 http://cc.oulu.fi/~jarioksa/opetus/metodi/vegantutor.pdf. Vegan has
 several
 functions which I believe should allow you to address some of your
 questions. I have not worked with functional groups, but I'm guessing you
 could treat them as you would treat taxa for statistical purposes (?). I
 think Vegan's function 'adonis' might be of interest to you. It allows you
 to partition variation in a data/distance matrix according to specified
 factors (e.g., water chemistry).

 Hopet this helps!

 Best,

 A


 On Wed, Dec 5, 2012 at 10:26 PM, Rich Shepard rshep...@appl-ecosys.com
 wrote:

I left academia and basic ecological research decades ago and now work
  with environmental data collected by companies in compliance with
  regulatory
  permit requirements. I've bought and read (mostly) all the books I could
  find on ecological analyses using R (all but one of Alain Zuur's books,
  Legendre  Legendre's 2nd English edition, Mike McCarthy's Bayesian
 methods
  book, and Ben Bolker's book) but cannot find any references to
  'communities'
  in the indices. I'd greatly appreciate pointers to sources appropriate
 for
  environmental data (which is much sloppier than ecological research
 data).
 
The last time I addressed community analyses was my post-doc research
  which I published in Freshwater Biology in 1984. Only within the past
 year
  have my clients needed to address issues using benthic macroinvertebrate
  assemblages (and fish) in streams. And, since I work by myself, I've no
 one
  with whom to share ideas and discuss approaches; perhaps there's a better
  forum than this mail list for this.
 
The available benthic data has little taxonomic consistency below the
  family level. I want to use functional feeding groups rather than taxa as
  the basis of comparison because those better reflect conditions in each
  stream (collections of biota are made only once per year), and I want to
  examine correlations and cause-and-effect relations between biotic
  assemblages and water chemistry. There are only a few fish collections,
  tool, in the available data.
 
All ideas are certainly welcome!
 
  TIA,
 
  Rich
 
  --
  Richard B. Shepard, Ph.D.  |   Integrity - Credibility -
 Innovation
  Applied Ecosystem Services, Inc.   |
  http://www.appl-ecosys.com Voice: 503-667-4517  Fax:
  503-667-8863
 
  __**_
  R-sig-ecology mailing list
  R-sig-ecology@r-project.org
  https://stat.ethz.ch/mailman/**listinfo/r-sig-ecology
 https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
 



 --
 Alfredo Tello (http://alfredotello.com)
 Sustainable Aquaculture Group
 Institute of Aquaculture
 University of Stirling
 Scotland, UK.

 [[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