I am running the following code on the coagulation data and I am getting an error. Please let me know if I am missing anything from my code. coag<- matrix( scan("//Samba3/nair/R/blood.dat", sep=","), 24, 3, byrow=TRUE) colnames(coag) <- c("time","diet","order") coag <- as.data.frame(coag) oneway.test(time ~ diet, data=coag, var.eq=TRUE) coag.mod <- aov(time ~ diet, data=coag) options(scipen=5) options(digits=5) TukeyHSD( coag.mod ) I get the following error when I run the above code Read 72 items Error in rep.int(n, length(means)) : Unimplemented feature in rep In addition: Warning message: non-factors ignored: diet in: replications(paste("~", paste(names(tables), collapse = "+")), The data is here .. 62,1,20 60,1,2 63,1,11 59,1,10 63,2,12 67,2,9 71,2,15 64,2,14 65,2,4 66,2,8 68,3,16 66,3,7 71,3,1 67,3,17 68,3,13 68,3,21 56,4,23 62,4,3 60,4,6 61,4,18 63,4,22 64,4,19 63,4,5 59,4,24 Thanks ../ Murli
You are trying to apply TukeyHSD to a linear regression. I think you want `diet' to be a factor, but it is not. (The warning message told you that.) The model needs to be coag.mod <- aov(time ~ factor(diet), data=coag) Function aov happily accepts continuous covariates as it can also do ANCOVA. On Thu, 26 Aug 2004, T. Murlidharan Nair wrote:> I am running the following code on the coagulation data and I am getting > an error. Please let me know > if I am missing anything from my code. > > coag<- matrix( scan("//Samba3/nair/R/blood.dat", sep=","), 24, 3, > byrow=TRUE) > colnames(coag) <- c("time","diet","order") > coag <- as.data.frame(coag) > oneway.test(time ~ diet, data=coag, var.eq=TRUE) > coag.mod <- aov(time ~ diet, data=coag) > options(scipen=5) > options(digits=5) > TukeyHSD( coag.mod ) > > > I get the following error when I run the above code > Read 72 items > Error in rep.int(n, length(means)) : Unimplemented feature in rep > In addition: Warning message: > non-factors ignored: diet in: replications(paste("~", > paste(names(tables), collapse = "+")),-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595