Hello all,

I am getting the following error:

Error in linear.hypothesis.mlm(mod, hyp.matrix.1, SSPE = SSPE, V = V,  :
  The error SSP matrix is apparently of deficient rank = 7 < 11

After running:
mod.ok <- lm(as.matrix(dat[,-1]) ~  DC, data=dat)
(av.ok <- Anova(mod.ok, idata=idata, idesign=~week))

Although if I jitter the data in "dat", the function seems to work.

What should I do ?

(here is a self sufficient example code of my situation)





#------------- R code --------------------

# creating data
idata <- structure(list(week = structure(1:12, .Label = c("week6", "week7",
"week8", "week9", "week10", "week11", "week12", "week13", "week14",
 "week15", "week16", "week17"), class = "factor")), .Names = "week",
row.names = c(NA,
-12L), class = "data.frame")

dat <- structure(list(DC = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L,
 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label =
c("control",
"head (20g)"), class = "factor"), week6 = c(4, 4, 4, 4, 4, 4,
 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4), week7 = c(4, 4, 4, 4, 4,
 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4), week8 = c(4, 4, 4, 4,
 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 3, 4, 3, 4, 4, 4, 4, 4), week9 = c(4, 4, 3,
 4, 4, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
3, 4, 4, 4, 4, 4, 4, 3, 4, 3, 4, 4, 4, 4, 3),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
"week13", "week14", "week15", "week16", "week17"), class = c("cast_df",
 "data.frame"), row.names = c(NA, 39L))
# This fails
mod.ok <- lm(as.matrix(dat[,-1]) ~  DC, data=dat)
(av.ok <- Anova(mod.ok, idata=idata, idesign=~week))

# But this works
dat[,-1] <- apply(dat[,-1],2, jitter )
mod.ok <- lm(as.matrix(dat[,-1]) ~  DC, data=dat)
(av.ok <- Anova(mod.ok, idata=idata, idesign=~week))

#------------- R code --------------------


Thanks in advance,
Tal

----------------Contact
Details:-------------------------------------------------------
Contact me: Tal.Galili@gmail.com |  972-52-7275845
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
www.r-statistics.com (English)
----------------------------------------------------------------------------------------------

	[[alternative HTML version deleted]]

