[R-sig-eco] anova.cca question / missing data in constraining matrix

Gavin Simpson gavin.simpson at ucl.ac.uk
Wed Jun 5 19:11:24 CEST 2013


On Tue, 2013-06-04 at 08:23 -0700, ckellogg wrote:
> Hi Jari,
> I have a final (hopefully) question.  I have narrowed down the number of
> environmental variables and removed some of the community (and associated
> env. data) rows if they are missing too many environmental variables.
> Then, when I run the anova.cca by terms I get the following error message.
> anova(m2,by='terms',perm=999)
> Error in La.svd(x, nu, nv) : error code 1 from Lapack routine 'dgesdd'

This pops up from time to time and IIRC relates to numerical issues for
the particular matrix - for example you are fitting too complex a model
for the data to support. It usually indicates something slightly on the
border of being ill-conditioned.

You can try reordering the data to see if that helps. Scaling the data
in some way may also help. Also try debugging the function call to see
in which of the terms the function is failing.

HTH

G

> any thoughts about why this is happening or how I can avoid it so that I
> can run the anova by terms.
> 
> Thank you so much for all of your help with this!
> 
> colleen
> 
> 
> 
> On Tue, Jun 4, 2013 at 1:59 AM, Jari Oksanen [via r-sig-ecology] <
> ml-node+s471788n7578184h50 at n2.nabble.com> wrote:
> 
> > Dear Colleen,
> > On 03/06/2013, at 22:32 PM, ckellogg wrote:
> >
> > > Hello Jari,
> > > Thank you for your help with this.  The solution you suggested in your
> > > second post worked quite well.  However, i think another subset of my
> > data
> > > is too 'holey', because when I run CCA on this set of environmental
> > > variables (or the a CCA with the previous environmental variables and
> > the
> > > additional ones), I get an error:
> > >
> > >> toolik250.cca2
> > >>
> > <-cca(toolikotus250.ra~logtemp+conductivity+pH+logBacProd+DIC+logDCO2+sqrtDCH4+logDOC+sqrtPhosphate+sqrtNitrate+sqrtTDN+sqrtTDP+logPC+logPN+Ca+Mg+logNa+logK+SO4+logChloride+Silica,toolikenv.s,
> >
> > >> na.action=na.exclude)
> > > Error in predict.cca(x, newdata = excluded, type = "wa", model = "CA") :
> > >  model “CA” has rank 0
> > >
> > > The CCA runs if I use na.action=na.omit, but then when I run the anovas,
> > > there is apparently no residual component.  For example,
> > > No residual component
> > >
> > > Model: cca(formula = toolikotus250.ra ~ logtemp + conductivity + pH +
> > > logBacProd + DIC + logDCO2 + sqrtDCH4 + logDOC + sqrtPhosphate +
> > sqrtNitrate
> > > + sqrtTDN + sqrtTDP + logPC + logPN + Ca + Mg + logNa + logK + SO4 +
> > > logChloride + Silica, data = toolikenv.s, na.action = na.omit, subset =
> > > -toolik250.cca2$na.action)
> > >         Df  Chisq F N.Perm Pr(>F)
> > > Model    12 5.3003        0
> > > Residual  0 0.0000
> > >
> > Yes, probably too many holes. You have no residual variation which
> > indicates that the number
> > of predictor variables (constraints) is higher than the number of
> > remaining observations.
> >
> > Cheers, Jari Oksanen
> >
> > > So, I am thinking that examining the relationship between the microbial
> > > community and this subset of environmental variables might not be
> > possible
> > > without my first manually curating which samples and variables should be
> > > included, correct?
> > >
> > > Thank you,
> > > Colleen
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > http://r-sig-ecology.471788.n2.nabble.com/anova-cca-question-missing-data-in-constraining-matrix-tp7578175p7578179.html
> > > Sent from the r-sig-ecology mailing list archive at Nabble.com.
> > >
> > > _______________________________________________
> > > R-sig-ecology mailing list
> > > [hidden email] <http://user/SendEmail.jtp?type=node&node=7578184&i=0>
> > > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
> >
> > --
> > Jari Oksanen, Dept Biology, Univ Oulu, 90014 Finland
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=7578184&i=1>,
> > Ph. +358 400 408593, http://cc.oulu.fi/~jarioksa
> >
> > _______________________________________________
> > R-sig-ecology mailing list
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=7578184&i=2>
> > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
> >
> >
> > ------------------------------
> >  If you reply to this email, your message will be added to the discussion
> > below:
> >
> > http://r-sig-ecology.471788.n2.nabble.com/anova-cca-question-missing-data-in-constraining-matrix-tp7578175p7578184.html
> >  To unsubscribe from anova.cca question / missing data in constraining
> > matrix, click here<http://r-sig-ecology.471788.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=7578175&code=Y3Rla2VsbG9nZ0BnbWFpbC5jb218NzU3ODE3NXw2MzE3Nzc4OTg=>
> > .
> > NAML<http://r-sig-ecology.471788.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
> >
> 
> 
> 
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

-- 
Gavin Simpson, PhD                          [t] +1 306 337 8863
Adjunct Professor, Department of Biology    [f] +1 306 337 2410
Institute of Environmental Change & Society [e] gavin.simpson at uregina.ca
523 Research and Innovation Centre          [tw] @ucfagls
University of Regina
Regina, SK S4S 0A2, Canada



More information about the R-sig-ecology mailing list