David Romano
2013-Feb-06 20:21 UTC
[R] how to extract test for collinearity and constantcy used in lda
Hi everyone, I'm trying to vectorize an application of lda to each 2D slice of a 3D array, but am running into trouble: It seems there are quite a few 2D slices that trigger either the "variables are collinear" warning, or worse, trigger a "variable appears to be constant within groups" error and fails (i.e., ceases computation rather than skips bad slice). There are cases where neither warning is literally true, so I expect the warning and error must be triggered in a neighborhood of collinearity and within-group-constancy, and I would like to be able to remove the offending slice in advance. Does anyone know where I can find the explicit tests that are used for these? Thanks in advance for any light you can help shed on this question. Best, David P.S. The 3D array has roughly 40K 2D slices, so inspection is not an option! [[alternative HTML version deleted]]
David Romano
2013-Feb-08 18:31 UTC
[R] how to extract test for collinearity and constantcy used in lda
Just posting to answer my own question, at least for the "variables constant" error: I hadn't noticed that lda has an argument called 'tol' that governs when variables are interpreted as constant within groups; it's right there in the help entry for lda, so I apologize for having missed it. As to the "variables collinear" warning, it's still not clear to me what level of correlation will trigger it. My apologies, David On Wed, Feb 6, 2013 at 12:21 PM, David Romano <dromano@stanford.edu> wrote:> Hi everyone, > > I'm trying to vectorize an application of lda to each 2D slice of a 3D > array, but am running into trouble: It seems there are quite a few 2D > slices that trigger either the "variables are collinear" warning, or worse, > trigger a "variable appears to be constant within groups" error and fails > (i.e., ceases computation rather than skips bad slice). > > There are cases where neither warning is literally true, so I expect the > warning and error must be triggered in a neighborhood of collinearity and > within-group-constancy, and I would like to be able to remove the offending > slice in advance. Does anyone know where I can find the explicit tests > that are used for these? > > Thanks in advance for any light you can help shed on this question. > > Best, > David > > P.S. The 3D array has roughly 40K 2D slices, so inspection is not an > option! >[[alternative HTML version deleted]]