[R-sig-eco] NA error in envfit
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
Re: [R-sig-eco] beta regression error
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
[R-sig-eco] R Ecology Workshop in Hawaii
Hello all, I'm a Masters student at the University of Hawaii Manoa, and I'm interested in organizing a weekend workshop for interested faculties on campus. Graduate students here at UHM in departments such as Geography, Zoology, Biology, Oceanography, and Botany have already been exposed to and work with R software to analyze ecological data. However, we have little resources when it comes to troubleshooting issues and learning R; in fact if you cant find an upper year experienced student the only options for you are online forums and intro books being passed around the departments. Our biometry classes offered at the graduate level cover JMP and Minitab efficiently, but the R coverage is more than lacking. Is there anyone who knows of a program or instructor/lecturer who would be willing to travel to Hawaii to teach a weekend course in the fundamentals of using R for ecological datasets? Or any information that they think would be useful really. Thank you for reading!! Mahalo! Alexandra Hedgpeth [[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] beta regression error
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
[R-sig-eco] Stats course in Coimbra, Portugal
There are a few remaining places on the following course: Data exploration, regression, GLM and GAM with introduction to R When: 3 - 7 February, 2014 Where: University of Coimbra, Coimbra, Portugal Further information: http://www.highstat.com/statscourse.htm Flyer: http://www.highstat.com/Courses/Flyer2014FebCoimbraV2.pdf Kind regards, Alain Zuur -- Dr. Alain F. Zuur First author of: 1. Analysing Ecological Data (2007) 2. Mixed effects models and extensions in ecology with R (2009) 3. A Beginner's Guide to R (2009) 4. Zero Inflated Models and GLMM with R (2012) 5. A Beginner's Guide to GAM (2012) 6. A Beginner's Guide to GLM and GLMM (2013) Highland Statistics Ltd. 6 Laverock road UK - AB41 6FN Newburgh Tel: 0044 1358 788177 Email: highs...@highstat.com URL: www.highstat.com URL: www.brodgar.com ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology