Yoav Avneon
2013-Jan-18 21:11 UTC
[R] Error in mer_finalize(ans) : Downdated X'X is not positive definite, 8.
Dear All, I have conducted an experiment in order to examine predation pressure in the surroundings of potential wildlife road-crossing structures. I have documented predation occurrence (binary?) in these structures and calculated several possible explanatory variables describing the spatial heterogeneity in several scales. At the landscape scale I have calculated the percentage of different land-uses (7) in buffers around the structures with changing radii (100m, 250m, 500m, 1000m and 2000m). For each radii I have generated a set of all possible models from the given 7 variables related to this radii. I have tried to account for random effects. A spatial random effect ? the structure itself as a repeated measurement, by adding the term (1|Road_Structure). A temporal random effect ? the observation session (is it correct to say that this examines possible learning in time ?), by adding the term (1|Session.ord). I have generated 4 sets for each radii: 1) with both random effects, 2+3) only one (each) random effect, and 4) none. I have tried to model the relationships using glm, glmer and lmer. The problem is that in the full model (all 7 variables) of some sets with random effects I get the following error: *Error in mer_finalize(ans) : Downdated X'X is not positive definite, 8.* The only record of this error I have found in the internet is for data with missing observation. This doesn't comply with my data set. I think it might be a singularity problem but I don't know how to check it, and as a result, I obviously don't know how to fix it. I have attached example R scripts (for the radius 2000) and the data table. Any help is highly appreciated ! Thanks and all the best, -- Yoav Avneon Department of Life Sciences The Spatial Ecology Lab Ben Gurion University of the Negev P.O.B. 653 Beer-Sheva 84105 ISRAEL +972-52-3391918 (mobile) +972-8-6461350 (lab) ------------------------------------------------------------------------------------------------------------------------------------------- Yoav Yeled Teva ANP_multi_landscape_No_RE_Buffer_2000m.R <http://r.789695.n4.nabble.com/file/n4656015/ANP_multi_landscape_No_RE_Buffer_2000m.R> ANP_multi_landscape_Plus_RE_Str_Session_Buffer_2000m.R <http://r.789695.n4.nabble.com/file/n4656015/ANP_multi_landscape_Plus_RE_Str_Session_Buffer_2000m.R> ANP_multi_landscape_Plus_RE_Str_Buffer_2000m.R <http://r.789695.n4.nabble.com/file/n4656015/ANP_multi_landscape_Plus_RE_Str_Buffer_2000m.R> ANP_multi_landscape_Plus_RE_Session_Buffer_2000m.R <http://r.789695.n4.nabble.com/file/n4656015/ANP_multi_landscape_Plus_RE_Session_Buffer_2000m.R> Raw_data_4_logit_reg_Only_str_point_all_Landscape_vars.txt <http://r.789695.n4.nabble.com/file/n4656015/Raw_data_4_logit_reg_Only_str_point_all_Landscape_vars.txt> -- View this message in context: http://r.789695.n4.nabble.com/Error-in-mer-finalize-ans-Downdated-X-X-is-not-positive-definite-8-tp4656015.html Sent from the R help mailing list archive at Nabble.com.
Ben Bolker
2013-Jan-19 20:37 UTC
[R] Error in mer_finalize(ans) : Downdated X'X is not positive definite, 8.
Yoav Avneon <Avneony <at> bgu.ac.il> writes:> I have conducted an experiment in order to examine predation pressure in the > surroundings of potential wildlife road-crossing structures. I have > documented predation occurrence (binary?) in these structures and calculated > several possible explanatory variables describing the spatial heterogeneity > in several scales. At the landscape scale I have calculated the percentage > of different land-uses (7) in buffers around the structures with changing > radii (100m, 250m, 500m, 1000m and 2000m). For each radii I have generated > a set of all possible models from the given 7 variables related to this > radii. > I have tried to account for random effects. A spatial random effect ? the > structure itself as a repeated measurement, by adding the term > (1|Road_Structure). A temporal random effect ? the observation session (is > it correct to say that this examines possible learning in time ?), by adding > the term (1|Session.ord). > I have generated 4 sets for each radii: 1) with both random effects, 2+3) > only one (each) random effect, and 4) none. > I have tried to model the relationships using glm, glmer and lmer. > The problem is that in the full model (all 7 variables) of some sets with > random effects I get the following error: > *Error in mer_finalize(ans) : Downdated X'X is not positive definite, 8.* > > The only record of this error I have found in the internet is for data with > missing observation. This doesn't comply with my data set. I think it > might be a singularity problem but I don't know how to check it, and as a > result, I obviously don't know how to fix it. > I have attached example R scripts (for the radius 2000) and the data table. > Any help is highly appreciated ! > Thanks and all the best,Questions like this (and follow-ups) should probably go to r-sig-mixed-models at r-project.org. I don't have time to dig into this in detail, but I would start by (1) centering and scaling all of your variables (see ?scale, and Schielzeth 2010 _Methods in Ecology and Evolution_ and (2) checking the correlations among your variables; if they are strongly correlated you have lots of options (none of them perfect), much discussed on the internet, including discarding some variables or using PCA.