[R] CoDA ANOVA Error

Rich Shepard rshepard at appl-ecosys.com
Fri May 8 20:34:56 CEST 2015


   I'm running linear regressions and ANOVAs on 5 sets of compositional data
following van den Boogaart and Tolosana-Delgado's book, pp. 129 ff. Four of
the five data sets compute without error; one does not. To test results,
load package 'compositions'.

   The input data:
<for Y>
structure(c(0.18968103189681, 0.0619, 0.0875, 0.102910291029103, 
0.1023, 0.482751724827517, 0.5773, 0.7125, 0.5000500050005, 0.5795, 
0.068993100689931, 0.0309, 0.0125, 0.0882088208820882, 0.0341, 
0.206879312068793, 0.2371, 0.1125, 0.235323532353235, 0.2614, 
0.0516948305169483, 0.0928, 0.075, 0.0735073507350735, 0.0227
), .Dim = c(5L, 5L), .Dimnames = list(NULL, c("Fi", "Ga", "Gr", 
"Pr", "Sh")), class = "acomp")
<for X>
c(0.31, 0.31, 0.21, 2, 0.31)

   Regression model:
( model <- lm(ilr(Y) ~ log(X)) )

   Convert back from ILR to original units:
( orig <- ilrInv(coef(model),orig=Y) )

   Then run the ANOVA:
( analvar <- anova(model) )

   The result displayed is:
Error in anova.mlm(model) : residuals have rank 3 < 4

   A Web search found a nabble thread from 2012 but that was related to using
the spephical model, not the Pillai model. I do not see differences between
the number of columns in the Y and X variables in the different data sets
that might throw that error. What might be the cause and is there anything I
can do to test the variable for significance?

Rich



More information about the R-help mailing list