R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing 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 + ,3 + ,1 + ,2 + ,1 + ,2 + ,3 + ,3 + ,2 + ,4 + ,3 + ,3 + ,5 + ,3 + ,1 + ,6 + ,1 + ,1 + ,7 + ,2 + ,2 + ,8 + ,3 + ,2 + ,9 + ,3 + ,1 + ,10 + ,2 + ,3 + ,11 + ,1 + ,1 + ,12 + ,1 + ,3 + ,13 + ,3 + ,2 + ,14 + ,3 + ,1 + ,15 + ,3 + ,2 + ,16 + ,1 + ,2 + ,17 + ,3 + ,2 + ,18 + ,3 + ,1 + ,19 + ,3 + ,3 + ,20 + ,2 + ,2 + ,21 + ,2 + ,1 + ,22 + ,1 + ,1 + ,23 + ,1 + ,1 + ,24 + ,3 + ,1 + ,25 + ,3 + ,2 + ,26 + ,1 + ,3 + ,27 + ,1 + ,2 + ,28 + ,3 + ,2 + ,29 + ,1 + ,2 + ,30 + ,2 + ,2 + ,31 + ,3 + ,2 + ,32 + ,2 + ,3 + ,33 + ,2 + ,2 + ,34 + ,3 + ,2 + ,35 + ,1 + ,2 + ,36 + ,3 + ,1 + ,37 + ,3 + ,2 + ,38 + ,1 + ,2 + ,39 + ,2 + ,3 + ,40 + ,1 + ,1 + ,41 + ,1 + ,2 + ,42 + ,2 + ,1 + ,43 + ,1 + ,2 + ,44 + ,1 + ,3 + ,45 + ,3 + ,2 + ,46 + ,2 + ,2 + ,47 + ,2 + ,3 + ,48 + ,1 + ,1 + ,49 + ,1 + ,1 + ,50 + ,1 + ,2 + ,51 + ,1 + ,2 + ,52 + ,2 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 + ,121 + ,3 + ,3 + ,122 + ,2 + ,1 + ,123 + ,3 + ,2 + ,124 + ,2 + ,2 + ,125 + ,2 + ,2 + ,126 + ,2 + ,1 + ,127 + ,3 + ,2 + ,128 + ,3 + ,1 + ,129 + ,1 + ,3 + ,130 + ,1 + ,3 + ,131 + ,3 + ,2 + ,132 + ,3 + ,2 + ,133 + ,2 + ,1 + ,134 + ,1 + ,3 + ,135 + ,3 + ,2 + ,136 + ,3 + ,1 + ,137 + ,3 + ,1 + ,138 + ,2 + ,1 + ,139 + ,1 + ,1 + ,140 + ,3 + ,2 + ,141 + ,3 + ,3 + ,142 + ,3 + ,2 + ,143 + ,2 + ,2 + ,144 + ,3 + ,1 + ,145 + ,2 + ,2 + ,146 + ,3 + ,1 + ,147 + ,3 + ,1 + ,148 + ,2 + ,2 + ,149 + ,3 + ,2 + ,150 + ,3 + ,2 + ,151 + ,3 + ,2 + ,152 + ,3 + ,3 + ,153 + ,1 + ,3 + ,154 + ,3 + ,3 + ,155 + ,2 + ,2 + ,156 + ,3 + ,2 + ,157 + ,3 + ,2 + ,158 + ,1 + ,1 + ,159 + ,1 + ,2 + ,160 + ,3 + ,1) + ,dim=c(3 + ,160) + ,dimnames=list(c('V1' + ,'V2' + ,'V3') + ,1:160)) > y <- array(NA,dim=c(3,160),dimnames=list(c('V1','V2','V3'),1:160)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'TRUE' > par2 = '2' > par1 = '1' > ylab = 'Y Variable Name' > xlab = 'X Variable Name' > main = 'Title Goes Here' > cat1 <- as.numeric(par1) # > cat2<- as.numeric(par2) # > intercept<-as.logical(par3) > x <- t(x) > x1<-as.numeric(x[,cat1]) > f1<-as.character(x[,cat2]) > xdf<-data.frame(x1,f1) > (V1<-dimnames(y)[[1]][cat1]) [1] "V1" > (V2<-dimnames(y)[[1]][cat2]) [1] "V2" > names(xdf)<-c('Response', 'Treatment') > if(intercept == FALSE) (lmxdf<-lm(Response ~ Treatment - 1, data = xdf) ) else (lmxdf<-lm(Response ~ Treatment, data = xdf) ) Call: lm(formula = Response ~ Treatment, data = xdf) Coefficients: (Intercept) Treatment2 Treatment3 71.050 7.859 15.345 > (aov.xdf<-aov(lmxdf) ) Call: aov(formula = lmxdf) Terms: Treatment Residuals Sum of Squares 6324.3 334995.7 Deg. of Freedom 2 157 Residual standard error: 46.19232 Estimated effects may be unbalanced > (anova.xdf<-anova(lmxdf) ) Analysis of Variance Table Response: Response Df Sum Sq Mean Sq F value Pr(>F) Treatment 2 6324 3162.2 1.482 0.2303 Residuals 157 334996 2133.7 > > #Note: the /var/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'ANOVA Model', length(lmxdf$coefficients)+1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, paste(V1, ' ~ ', V2), length(lmxdf$coefficients)+1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'means',,TRUE) > for(i in 1:length(lmxdf$coefficients)){ + a<-table.element(a, round(lmxdf$coefficients[i], digits=3),,FALSE) + } > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/fisher/rcomp/tmp/1m7t21384100830.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'ANOVA Statistics', 5+1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, ' ',,TRUE) > a<-table.element(a, 'Df',,FALSE) > a<-table.element(a, 'Sum Sq',,FALSE) > a<-table.element(a, 'Mean Sq',,FALSE) > a<-table.element(a, 'F value',,FALSE) > a<-table.element(a, 'Pr(>F)',,FALSE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, V2,,TRUE) > a<-table.element(a, anova.xdf$Df[1],,FALSE) > a<-table.element(a, round(anova.xdf$'Sum Sq'[1], digits=3),,FALSE) > a<-table.element(a, round(anova.xdf$'Mean Sq'[1], digits=3),,FALSE) > a<-table.element(a, round(anova.xdf$'F value'[1], digits=3),,FALSE) > a<-table.element(a, round(anova.xdf$'Pr(>F)'[1], digits=3),,FALSE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Residuals',,TRUE) > a<-table.element(a, anova.xdf$Df[2],,FALSE) > a<-table.element(a, round(anova.xdf$'Sum Sq'[2], digits=3),,FALSE) > a<-table.element(a, round(anova.xdf$'Mean Sq'[2], digits=3),,FALSE) > a<-table.element(a, ' ',,FALSE) > a<-table.element(a, ' ',,FALSE) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/fisher/rcomp/tmp/2x4211384100830.tab") > postscript(file="/var/fisher/rcomp/tmp/3ylsa1384100830.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > boxplot(Response ~ Treatment, data=xdf, xlab=V2, ylab=V1) > dev.off() null device 1 > if(intercept==TRUE){ + thsd<-TukeyHSD(aov.xdf) + postscript(file="/var/fisher/rcomp/tmp/4ax0x1384100830.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(thsd) + dev.off() + } null device 1 > if(intercept==TRUE){ + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Tukey Honest Significant Difference Comparisons', 5,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a, ' ', 1, TRUE) + for(i in 1:4){ + a<-table.element(a,colnames(thsd[[1]])[i], 1, TRUE) + } + a<-table.row.end(a) + for(i in 1:length(rownames(thsd[[1]]))){ + a<-table.row.start(a) + a<-table.element(a,rownames(thsd[[1]])[i], 1, TRUE) + for(j in 1:4){ + a<-table.element(a,round(thsd[[1]][i,j], digits=3), 1, FALSE) + } + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/fisher/rcomp/tmp/5pyg01384100830.tab") + } > if(intercept==FALSE){ + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'TukeyHSD Message', 1,TRUE) + a<-table.row.end(a) + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Must Include Intercept to use Tukey Test ', 1, FALSE) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/fisher/rcomp/tmp/6oavv1384100830.tab") + } > library(car) Loading required package: MASS Loading required package: nnet > lt.lmxdf<-levene.test(lmxdf) Warning message: 'levene.test' is deprecated. Use 'leveneTest' instead. See help("Deprecated") and help("car-deprecated"). > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Levenes Test for Homogeneity of Variance', 4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,' ', 1, TRUE) > for (i in 1:3){ + a<-table.element(a,names(lt.lmxdf)[i], 1, FALSE) + } > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Group', 1, TRUE) > for (i in 1:3){ + a<-table.element(a,round(lt.lmxdf[[i]][1], digits=3), 1, FALSE) + } > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,' ', 1, TRUE) > a<-table.element(a,lt.lmxdf[[1]][2], 1, FALSE) > a<-table.element(a,' ', 1, FALSE) > a<-table.element(a,' ', 1, FALSE) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/fisher/rcomp/tmp/7gwoh1384100830.tab") > > try(system("convert tmp/3ylsa1384100830.ps tmp/3ylsa1384100830.png",intern=TRUE)) character(0) > try(system("convert tmp/4ax0x1384100830.ps tmp/4ax0x1384100830.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.731 0.485 2.192