R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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(0.175856683,'Control',-0.447651543,'Control',1.189631467,'Control',0.630458094,'Control',0.799144649,'Control',-1.092828626,'Control',-1.238732879,'Control',1.16725143,'Control',-0.113810912,'TreatA',1.679383017,'TreatA',2.436619868,'TreatA',0.303840895,'TreatA',2.087609483,'TreatA',1.505986604,'TreatA',0.514409262,'TreatA',1.446292098,'TreatA',-0.234668772,'TreatB',1.873012882,'TreatB',-0.229861698,'TreatB',-0.421339844,'TreatB',2.09408266,'TreatB',-0.206760875,'TreatB',-1.821729039,'TreatB',2.229756407,'TreatB'),dim=c(2,24),dimnames=list(c('treatment','post3-pre'),1:24)) > y <- array(NA,dim=c(2,24),dimnames=list(c('treatment','post3-pre'),1:24)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } There were 24 warnings (use warnings() to see them) > par3 = 'TRUE' > par2 = '1' > par1 = '2' > ylab = 'Y Variable Name' > xlab = 'X Variable Name' > main = 'Title Goes Here' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2009, YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: > #Technical description: > cat1 <- as.numeric(par1) # > cat2<- as.numeric(par2) # > intercept<-as.logical(par3) > x <- t(x) > x1<-as.numeric(x[,cat1]) There were 24 warnings (use warnings() to see them) > f1<-as.character(x[,cat2]) > xdf<-data.frame(x1,f1) > (V1<-dimnames(y)[[1]][cat1]) [1] "post3-pre" > (V2<-dimnames(y)[[1]][cat2]) [1] "treatment" > names(xdf)<-c('Response', 'Treatment') > if(intercept == FALSE) (lmxdf<-lm(Response ~ Treatment - 1, data = xdf) ) else (lmxdf<-lm(Response ~ Treatment, data = xdf) ) Error in `contrasts<-`(`*tmp*`, value = "contr.treatment") : contrasts can be applied only to factors with 2 or more levels Calls: lm ... model.matrix -> model.matrix.default -> contrasts<- Execution halted