[R-sig-eco] AdehabitatHR package
Hi, I am working on shark satellite tracking data and Im trying to use the function kernelbb from the *adehabitatHR package *to calculate home range. Some functions from *adehabitatHR *accept the use of a boundary and I was wondering if there is a way to use a boundary with kernelbb? Kind Regards, Luciana Ferreira -- PhD Candidate The UWA Oceans Institute - Centre for Marine Futures Australian Institute of Marine Sciences (AIMS) Mailing address: Australian Institute of Marine Sciences The UWA Oceans Institute(MO96) 35 Stirling Highway Crawley WA,6009 +61 08 6369 4002 -- PhD Candidate The UWA Oceans Institute - Centre for Marine Futures Australian Institute of Marine Sciences (AIMS) Mailing address: Australian Institute of Marine Sciences The UWA Oceans Institute(MO96) 35 Stirling Highway Crawley WA,6009 +61 08 6369 4002 [[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] Dealing with overdispersion in mixed model with count data
Bradley Carlson writes: > > > I'd be curious to hear from others if whether there are inherent flaws in > this approach. I'm not terribly experienced in this area but this was the > solution I came upon when I dealt with this issue myself. > There's a bit more information, and a variety of references on observation-level random effects, at http://glmm.wikidot.com/faq#overdispersion Ben Bolker ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] NA error in envfit
Kendra, Something is wrong in X or P; find out what the foreign function call is and then you may be able to track down the offending data problem. Maybe a logarithm somewhere? This is probably not much help; I don't have much experience with envfit. Stephen On 12/03/2013 07:06 PM, Mitchell, Kendra wrote: I'm running a bunch of NMS with vectors fitted (slicing and dicing a large dataset in different ways). I'm suddenly getting an error from envfit f.bSBS.org.fit<-envfit(f.bSBS.org.nms, f.bSBS.org.env, permutations=999, na.rm=TRUE) Error in vectorfit(X, P, permutations, strata, choices, w = w, ...) : NA/NaN/Inf in foreign function call (arg 1) In addition: Warning message: In vectorfit(X, P, permutations, strata, choices, w = w, ...) : NAs introduced by coercion I can plot the NMS and even run ordifit on individual env variables, so can't figure out what the problem is. There aren't any NA/NaN/Inf in either of those data that I can find. I've tried running it without na.rm=TRUE and still get the error. Guidance on how to fix this would be appreciated. Here's the whole slicing process and str for the data f.bSBS.org<-f.env$zone.hor=="bSBS.1" f.bSBS.org.tyc<-f.tyc[f.bSBS.org,f.bSBS.org] f.bSBS.org.env<-subset(f.env, f.env$zone.hor=="bSBS.1") f.bSBS.org.nms<-metaMDS(as.dist(f.bSBS.org.tyc), k=3, trymin=50, trymax=250, wascores=FALSE) f.bSBS.org.fit<-envfit(f.bSBS.org.nms, f.bSBS.org.env, permutations=999, na.rm=TRUE) str(f.bSBS.org.env) 'data.frame':63 obs. of 14 variables: $ zone : Factor w/ 6 levels "bIDF","bSBS",..: 2 2 2 2 2 2 2 2 2 2 ... $ site : Factor w/ 18 levels "A7","A8","A9",..: 12 12 12 12 12 12 12 12 12 12 ... $ om : Factor w/ 4 levels "0","1","2","3": 2 2 2 3 3 3 2 2 2 3 ... $ compaction : num 1 1 1 1 1 1 1 1 1 1 ... $ herbicide: num 0 0 0 0 0 0 0 0 0 0 ... $ horizon : Factor w/ 2 levels "1","2": 1 1 1 1 1 1 1 1 1 1 ... $ Water_content: num 50.3 50.3 50.3 50.1 50.1 ... $ DNA_ug_g : num 71.2 71.2 71.2 68.6 68.6 ... $ C: num 30.5 30.5 30.5 28.4 28.4 ... $ N: num 0.863 0.863 0.863 0.81 0.81 ... $ pH_H2O : num 4.63 4.63 4.63 4.49 4.49 ... $ CN : num 35.3 35.3 35.3 35.1 35.1 ... $ f.env$zone : Factor w/ 6 levels "bIDF","bSBS",..: 2 2 2 2 2 2 2 2 2 2 ... $ zone.hor : chr "bSBS.1" "bSBS.1" "bSBS.1" "bSBS.1" ... str(f.bSBS.org.nms) List of 35 $ nobj : int 63 $ nfix : int 0 $ ndim : num 3 $ ndis : int 1953 $ ngrp : int 1 $ diss : num [1:1953] 0.00424 0.00437 0.05169 0.07522 0.11039 ... $ iidx : int [1:1953] 12 8 55 56 52 7 56 12 59 52 ... $ jidx : int [1:1953] 7 6 18 55 8 3 18 3 12 49 ... $ xinit : num [1:189] 0.654 0.837 0.438 0.105 -0.313 ... $ istart: int 1 $ isform: int 1 $ ities : int 1 $ iregn : int 1 $ iscal : int 1 $ maxits: int 200 $ sratmx: num 1 $ strmin: num 1e-04 $ sfgrmn: num 1e-07 $ dist : num [1:1953] 0.0679 0.0231 0.3598 0.1248 0.1422 ... $ dhat : num [1:1953] 0.0455 0.0455 0.2076 0.2076 0.2076 ... $ points: num [1:63, 1:3] -0.1256 0.1224 0.267 0.2374 -0.0427 ... ..- attr(*, "dimnames")=List of 2 .. ..$ : chr [1:63] "LL001" "LL002" "LL003" "LL007" ... .. ..$ : chr [1:3] "MDS1" "MDS2" "MDS3" ..- attr(*, "centre")= logi TRUE ..- attr(*, "pc")= logi TRUE ..- attr(*, "halfchange")= logi FALSE $ stress: num 0.157 $ grstress : num 0.157 $ iters : int 180 $ icause: int 3 $ call : language metaMDS(comm = as.dist(f.bSBS.org.tyc), k = 3, trymax = 250, wascores = FALSE, trymin = 50) $ model : chr "global" $ distmethod: chr "user supplied" $ distcall : chr "as.dist.default(m = f.bSBS.org.tyc)" $ distance : chr "user supplied" $ converged : logi TRUE $ tries : num 23 $ engine: chr "monoMDS" $ species : logi NA $ data : chr "as.dist(f.bSBS.org.tyc)" - attr(*, "class")= chr [1:2] "metaMDS" "monoMDS" -- Kendra Maas Mitchell, Ph.D. Post Doctoral Research Fellow University of British Columbia 604-822-5646 [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology -- Stephen Sefick ** Auburn University Biological Sciences 331 Funchess Hall Auburn, Alabama 36849 ** sas0...@auburn.edu http://www.auburn.edu/~sas0025 ** Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis "A big computer, a compl
Re: [R-sig-eco] Community composition variance partitioning?
Alexandre, I'll leave it to Sarah to advise you on MRM (and I agree with Jari that the method you're describing is not going to work). I'll just add that it is not clear to me why the predictors (even geographic distance) have to be treated as distances to partition the variance in composition. I'm assuming the environmental variables were not originally in the form of euclidean distance matrices and that the raw measurements are available? As for the geographic distances, if you have lat and long coordinates, why not treat both lat and long as predictors and do the necessary analyses as partial distance-based redundancy analyses using capscale? In one analysis the geographic predictors could be partialled out (with the result explaining the fraction explained by the environment). In another, the environmental predictors could be partialled out (with the result explaining the fraction explained by the geographic distance) and in a third both geographic and environmental predictors could be considered with no conditioning covariates (which will give the total variance explained by both combined). Best Steve J. Stephen Brewer Professor Department of Biology PO Box 1848 University of Mississippi University, Mississippi 38677-1848 Brewer web page - http://home.olemiss.edu/~jbrewer/ FAX - 662-915-5144 Phone - 662-915-1077 On 12/4/13 11:50 AM, "Alexandre Fadigas de Souza" wrote: >Dear friends, > > My name is Alexandre and I am trying to analyze a dataset on floristic >composition of tropical coastal vegetation by means of variance >partition, according to the outlines of a Tuomisto's recent papers, >specially > >Tuomisto, H., Ruokolainen, L., Ruokolainen, K., 2012. Modelling niche and >neutral dynamics : on the ecological interpretation of variation >partitioning results. Ecography (Cop.). 35, 961971. > > I have a doubt, could you please give your opinion on it? > > We are proceeding a variance partition of the bray-curtis floristic >distance using as explanatory fractions soil nutrition, topography, >canopy openess and geographical distances (all as euclidean distance >matrices). > >We are using the MRM function of the ecodist package: > >mrm <- MRM(dist(species) ~ dist(soil) + dist(topograph) + dist(light) + >dist(xy), data=my.data, nperm=1 > >The idea is that the overall R2 of this multiple regression should be >used to assess the contributions of the spatial and environmental >fractions through subtraction : > >Three separate multiple regression analyses are needed >to assess the relative explanatory power of geographical >and environmental distances. All of these have the same >response variable (the compositional dissimilarity matrix), >but each analysis uses a diff erent set of the explanatory >variables. In these analyses the explanatory variables are: >(I) the geographical distance matrix only, (II) the environmental >diff erence matrices only, and (III) all the explanatory >variables used in (I) or (II). Comparing the R 2 values >from these three analyses allows partitioning the variance >of the response dissimilarity matrix to four fractions. >Fraction A is explained uniquely by the environmental >diff erence matrices and equals R2 (III) R2 (I). Fraction B >is explained jointly by the environmental and geographical >distances and equals R2 (I) R2 (II) R2 (III). Fraction C >is explained uniquely by geographical distances and >equals R2 (III) R2 (II). Fraction D is unexplained by the >available environmental and geographical dissimilarity >matrices and equals 100% R2 (III) (throughout the present >paper, R2 values are expressed as percentages rather >than proportions). [Tuomisto et al. 2012] > >The problem is that the R2 of the overall model (containing all the >explanatory variables) is smaller than most of the R2 of models >containing each of the explanatory matrices. So it seems not possible to >proceed with the approach proposed. > > >Sincerely, > >Alexandre > >Dr. Alexandre F. Souza >Professor Adjunto II Departamento de Botanica, Ecologia e Zoologia >Universidade Federal do Rio Grande do Norte (UFRN) >http://www.docente.ufrn.br/alexsouza Curriculo: >lattes.cnpq.br/7844758818522706 > >___ >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] Community composition variance partitioning?
Hi, Not only odd, but impossible. If you have a model y ~ x1, and you *add* a new explanatory variable, you cannot get worse in raw R2. You can get worse in adjusted R2. You can also get worse if you add variables to a matrix for which you calculate distances. So dist(y) ~ dist([x1]) can have higher R2 than dist(y) ~ dist([x1,x2]) -- bioenv is based on this. Cheers, Jari Oksanen Sent from my iPad > On 4.12.2013, at 20.19, "Sarah Goslee" wrote: > > Hi, > > That seems a bit odd: can you provide a reproducible example, off-list > if necessary? > > Sarah > > > > On Wed, Dec 4, 2013 at 12:50 PM, Alexandre Fadigas de Souza > wrote: >> Dear friends, >> >> My name is Alexandre and I am trying to analyze a dataset on floristic >> composition of tropical coastal vegetation by means of variance partition, >> according to the outlines of a Tuomisto's recent papers, specially >> >> Tuomisto, H., Ruokolainen, L., Ruokolainen, K., 2012. Modelling niche and >> neutral dynamics : on the ecological interpretation of variation >> partitioning results. Ecography (Cop.). 35, 961–971. >> >> I have a doubt, could you please give your opinion on it? >> >> We are proceeding a variance partition of the bray-curtis floristic >> distance using as explanatory fractions soil nutrition, topography, canopy >> openess and geographical distances (all as euclidean distance matrices). >> >> We are using the MRM function of the ecodist package: >> >> mrm <- MRM(dist(species) ~ dist(soil) + dist(topograph) + dist(light) + >> dist(xy), data=my.data, nperm=1 >> >> The idea is that the overall R2 of this multiple regression should be used >> to assess the contributions of the spatial and environmental fractions >> through subtraction : >> >> Three separate multiple regression analyses are needed >> to assess the relative explanatory power of geographical >> and environmental distances. All of these have the same >> response variable (the compositional dissimilarity matrix), >> but each analysis uses a diff erent set of the explanatory >> variables. In these analyses the explanatory variables are: >> (I) the geographical distance matrix only, (II) the environmental >> diff erence matrices only, and (III) all the explanatory >> variables used in (I) or (II). Comparing the R 2 values >> from these three analyses allows partitioning the variance >> of the response dissimilarity matrix to four fractions. >> Fraction A is explained uniquely by the environmental >> diff erence matrices and equals R2 (III) R2 (I). Fraction B >> is explained jointly by the environmental and geographical >> distances and equals R2 (I) R2 (II) R2 (III). Fraction C >> is explained uniquely by geographical distances and >> equals R2 (III) R2 (II). Fraction D is unexplained by the >> available environmental and geographical dissimilarity >> matrices and equals 100% R2 (III) (throughout the present >> paper, R2 values are expressed as percentages rather >> than proportions). [Tuomisto et al. 2012] >> >> The problem is that the R2 of the overall model (containing all the >> explanatory variables) is smaller than most of the R2 of models containing >> each of the explanatory matrices. So it seems not possible to proceed with >> the approach proposed. >> >> >>Sincerely, >> >>Alexandre >> >> Dr. Alexandre F. Souza >> Professor Adjunto II Departamento de Botanica, Ecologia e Zoologia >> Universidade Federal do Rio Grande do Norte (UFRN) >> http://www.docente.ufrn.br/alexsouza Curriculo: >> lattes.cnpq.br/7844758818522706 >> >> ___ >> R-sig-ecology mailing list >> R-sig-ecology@r-project.org >> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology > > > > -- > Sarah Goslee > http://www.stringpage.com > http://www.sarahgoslee.com > http://www.functionaldiversity.org > > ___ > 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] Community composition variance partitioning?
Hi, That seems a bit odd: can you provide a reproducible example, off-list if necessary? Sarah On Wed, Dec 4, 2013 at 12:50 PM, Alexandre Fadigas de Souza wrote: > Dear friends, > >My name is Alexandre and I am trying to analyze a dataset on floristic > composition of tropical coastal vegetation by means of variance partition, > according to the outlines of a Tuomisto's recent papers, specially > > Tuomisto, H., Ruokolainen, L., Ruokolainen, K., 2012. Modelling niche and > neutral dynamics : on the ecological interpretation of variation partitioning > results. Ecography (Cop.). 35, 961–971. > >I have a doubt, could you please give your opinion on it? > >We are proceeding a variance partition of the bray-curtis floristic > distance using as explanatory fractions soil nutrition, topography, canopy > openess and geographical distances (all as euclidean distance matrices). > > We are using the MRM function of the ecodist package: > > mrm <- MRM(dist(species) ~ dist(soil) + dist(topograph) + dist(light) + > dist(xy), data=my.data, nperm=1 > > The idea is that the overall R2 of this multiple regression should be used to > assess the contributions of the spatial and environmental fractions through > subtraction : > > Three separate multiple regression analyses are needed > to assess the relative explanatory power of geographical > and environmental distances. All of these have the same > response variable (the compositional dissimilarity matrix), > but each analysis uses a diff erent set of the explanatory > variables. In these analyses the explanatory variables are: > (I) the geographical distance matrix only, (II) the environmental > diff erence matrices only, and (III) all the explanatory > variables used in (I) or (II). Comparing the R 2 values > from these three analyses allows partitioning the variance > of the response dissimilarity matrix to four fractions. > Fraction A is explained uniquely by the environmental > diff erence matrices and equals R2 (III) R2 (I). Fraction B > is explained jointly by the environmental and geographical > distances and equals R2 (I) R2 (II) R2 (III). Fraction C > is explained uniquely by geographical distances and > equals R2 (III) R2 (II). Fraction D is unexplained by the > available environmental and geographical dissimilarity > matrices and equals 100% R2 (III) (throughout the present > paper, R2 values are expressed as percentages rather > than proportions). [Tuomisto et al. 2012] > > The problem is that the R2 of the overall model (containing all the > explanatory variables) is smaller than most of the R2 of models containing > each of the explanatory matrices. So it seems not possible to proceed with > the approach proposed. > > > Sincerely, > > Alexandre > > Dr. Alexandre F. Souza > Professor Adjunto II Departamento de Botanica, Ecologia e Zoologia > Universidade Federal do Rio Grande do Norte (UFRN) > http://www.docente.ufrn.br/alexsouza Curriculo: > lattes.cnpq.br/7844758818522706 > > ___ > R-sig-ecology mailing list > R-sig-ecology@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology -- Sarah Goslee http://www.stringpage.com http://www.sarahgoslee.com http://www.functionaldiversity.org ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
[R-sig-eco] Community composition variance partitioning?
Dear friends, My name is Alexandre and I am trying to analyze a dataset on floristic composition of tropical coastal vegetation by means of variance partition, according to the outlines of a Tuomisto's recent papers, specially Tuomisto, H., Ruokolainen, L., Ruokolainen, K., 2012. Modelling niche and neutral dynamics : on the ecological interpretation of variation partitioning results. Ecography (Cop.). 35, 961–971. I have a doubt, could you please give your opinion on it? We are proceeding a variance partition of the bray-curtis floristic distance using as explanatory fractions soil nutrition, topography, canopy openess and geographical distances (all as euclidean distance matrices). We are using the MRM function of the ecodist package: mrm <- MRM(dist(species) ~ dist(soil) + dist(topograph) + dist(light) + dist(xy), data=my.data, nperm=1 The idea is that the overall R2 of this multiple regression should be used to assess the contributions of the spatial and environmental fractions through subtraction : Three separate multiple regression analyses are needed to assess the relative explanatory power of geographical and environmental distances. All of these have the same response variable (the compositional dissimilarity matrix), but each analysis uses a diff erent set of the explanatory variables. In these analyses the explanatory variables are: (I) the geographical distance matrix only, (II) the environmental diff erence matrices only, and (III) all the explanatory variables used in (I) or (II). Comparing the R 2 values from these three analyses allows partitioning the variance of the response dissimilarity matrix to four fractions. Fraction A is explained uniquely by the environmental diff erence matrices and equals R2 (III) R2 (I). Fraction B is explained jointly by the environmental and geographical distances and equals R2 (I) R2 (II) R2 (III). Fraction C is explained uniquely by geographical distances and equals R2 (III) R2 (II). Fraction D is unexplained by the available environmental and geographical dissimilarity matrices and equals 100% R2 (III) (throughout the present paper, R2 values are expressed as percentages rather than proportions). [Tuomisto et al. 2012] The problem is that the R2 of the overall model (containing all the explanatory variables) is smaller than most of the R2 of models containing each of the explanatory matrices. So it seems not possible to proceed with the approach proposed. Sincerely, Alexandre Dr. Alexandre F. Souza Professor Adjunto II Departamento de Botanica, Ecologia e Zoologia Universidade Federal do Rio Grande do Norte (UFRN) http://www.docente.ufrn.br/alexsouza Curriculo: lattes.cnpq.br/7844758818522706 ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] beta regression error
Thank you, Peter! Attila 2013/12/3 Peter Solymos > Attila, > > See paper and R code by Millar et al. 2011 for a solution based on 'glm': > http://www.esapubs.org/archive///ecol/E092/146/ > > Peter > > -- > Péter Sólymos, Dept Biol Sci, Univ Alberta, T6G 2E9, Canada AB > soly...@ualberta.ca, Ph 780.492.8534, http://psolymos.github.com > Alberta Biodiversity Monitoring Institute, http://www.abmi.ca > Boreal Avian Modelling Project, http://www.borealbirds.ca > > > On Tue, Dec 3, 2013 at 9:23 AM, Attila Lengyel wrote: > >> Dear All, >> >> I have a problem with 'betareg' function of 'betareg' package, would you, >> please, help me? I am trying to model compositional similarity on range >> (0; >> 1) between pairs of sample units as a function of pairwise geographical >> distances, and I often get an error message like this: >> >> "Error in chol.default(K) : >> the leading minor of order 3 is not positive definite >> In addition: Warning message: >> In sqrt(wpp) : NaNs produced >> Error in chol.default(K) : >> the leading minor of order 3 is not positive definite >> In addition: Warning messages: >> 1: In betareg.fit(X, Y, Z, weights, offset, link, link.phi, type, >> control) : >> failed to invert the information matrix: iteration stopped prematurely >> 2: In sqrt(wpp) : NaNs produced" >> >> The problem occurs with any link function. I read that this error is >> caused >> when my matrix is not positive definite. But how should I avoid this if >> these are the data I have? >> >> Thank you and best regards, >> >> Attila Lengyel >> >> [[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