R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(1,1,'T',0,0,'T',0,0,'T',0,0,'T',0,0,'T',0,2,'T',0,0,'T',1,0,'T',0,0,'T',0,1,'T',1,1,'T',0,0,'T',0,2,'T',1,1,'T',0,2,'T',1,2,'T',1,4,'T',1,1,'T',0,0,'T',1,3,'T',0,2,'T',0,3,'T',0,1,'T',0,2,'T',1,1,'T',0,2,'T',0,1,'T',0,1,'T',0,0,'T',0,1,'T',0,0,'T',0,1,'T',0,2,'T',1,0,'T',0,0,'T',0,0,'T',1,3,'T',0,1,'T',0,1,'T',1,1,'T',0,3,'T',0,1,'T',0,2,'T',1,1,'T',0,1,'T',0,1,'T',0,0,'T',0,0,'T',0,1,'T',0,0,'T',1,1,'T',1,4,'T',0,0,'T',0,2,'T',0,0,'T',1,1,'T',0,2,'T',0,0,'T',0,0,'T',1,4,'T',1,1,'T',0,2,'T',0,0,'T',1,1,'T',0,0,'T',0,0,'T',1,3,'T',0,1,'T',0,0,'T',0,1,'T',0,0,'T',0,0,'T',0,1,'T',0,2,'T',0,0,'T',1,1,'T',0,0,'T',0,2,'T',1,2,'T',1,1,'T',0,0,'T',0,2,'T',0,0,'T',0,2,'T',0,1,'T',0,1,'T'),dim=c(3,86),dimnames=list(c('Treatment','Score','T40'),1:86)) > y <- array(NA,dim=c(3,86),dimnames=list(c('Treatment','Score','T40'),1:86)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } There were 50 or more warnings (use warnings() to see the first 50) > par4 = 'TRUE' > par3 = '1' > par2 = '3' > par1 = '2' > ylab = 'Y Variable Name' > xlab = 'X Variable Name' > main = 'Title Goes Here' > cat1 <- as.numeric(par1) # > cat2<- as.numeric(par2) # > cat3 <- as.numeric(par3) > intercept<-as.logical(par4) > x <- t(x) > x1<-as.numeric(x[,cat1]) > f1<-as.character(x[,cat2]) > f2 <- as.character(x[,cat3]) > xdf<-data.frame(x1,f1, f2) > (V1<-dimnames(y)[[1]][cat1]) [1] "Score" > (V2<-dimnames(y)[[1]][cat2]) [1] "T40" > (V3 <-dimnames(y)[[1]][cat3]) [1] "Treatment" > names(xdf)<-c('Response', 'Treatment_A', 'Treatment_B') > if(intercept == FALSE) (lmxdf<-lm(Response ~ Treatment_A * Treatment_B- 1, data = xdf) ) else (lmxdf<-lm(Response ~ Treatment_A * Treatment_B, data = xdf) ) Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) : contrasts can be applied only to factors with 2 or more levels Calls: lm ... model.matrix -> model.matrix.default -> contrasts<- Execution halted