R version 2.12.0 (2010-10-15) Copyright (C) 2010 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(36 + ,67 + ,36 + ,86 + ,56 + ,86 + ,48 + ,103 + ,32 + ,74 + ,44 + ,63 + ,39 + ,82 + ,34 + ,93 + ,41 + ,77 + ,50 + ,111 + ,39 + ,71 + ,62 + ,103 + ,52 + ,89 + ,37 + ,75 + ,50 + ,88 + ,41 + ,84 + ,55 + ,85 + ,41 + ,70 + ,56 + ,104 + ,39 + ,88 + ,52 + ,77 + ,46 + ,77 + ,44 + ,72 + ,48 + ,70 + ,41 + ,83 + ,50 + ,110 + ,50 + ,91 + ,44 + ,80 + ,52 + ,91 + ,54 + ,86 + ,44 + ,85 + ,52 + ,107 + ,37 + ,93 + ,52 + ,87 + ,50 + ,84 + ,36 + ,73 + ,50 + ,84 + ,52 + ,86 + ,55 + ,99 + ,31 + ,75 + ,36 + ,87 + ,49 + ,79 + ,42 + ,82 + ,37 + ,95 + ,41 + ,84 + ,30 + ,85 + ,52 + ,95 + ,30 + ,63 + ,41 + ,78 + ,44 + ,85 + ,66 + ,86 + ,48 + ,75 + ,43 + ,98 + ,57 + ,71 + ,46 + ,63 + ,54 + ,71 + ,48 + ,84 + ,48 + ,81 + ,52 + ,93 + ,62 + ,79 + ,58 + ,63 + ,58 + ,93 + ,62 + ,92 + ,48 + ,93 + ,46 + ,83 + ,34 + ,80 + ,66 + ,111 + ,52 + ,92 + ,55 + ,79 + ,55 + ,69 + ,57 + ,83 + ,56 + ,80 + ,55 + ,91 + ,56 + ,97 + ,54 + ,85 + ,55 + ,85 + ,46 + ,99 + ,52 + ,67 + ,32 + ,87 + ,44 + ,68 + ,46 + ,81 + ,59 + ,80 + ,46 + ,93 + ,46 + ,93 + ,54 + ,102 + ,66 + ,104 + ,56 + ,90 + ,59 + ,85 + ,57 + ,92 + ,52 + ,82 + ,48 + ,85 + ,44 + ,89 + ,41 + ,77 + ,50 + ,79 + ,48 + ,76 + ,48 + ,101 + ,59 + ,81 + ,34 + ,92 + ,46 + ,89 + ,54 + ,81 + ,55 + ,77 + ,54 + ,95 + ,59 + ,85 + ,44 + ,81 + ,54 + ,76 + ,52 + ,93 + ,66 + ,104 + ,44 + ,89 + ,57 + ,76 + ,39 + ,77 + ,60 + ,71 + ,45 + ,79 + ,41 + ,89 + ,50 + ,81 + ,39 + ,99 + ,43 + ,81 + ,48 + ,84 + ,37 + ,85 + ,58 + ,111 + ,46 + ,78 + ,43 + ,111 + ,44 + ,78 + ,34 + ,87 + ,30 + ,92 + ,50 + ,93 + ,39 + ,70 + ,37 + ,84 + ,55 + ,75 + ,48 + ,105 + ,41 + ,96 + ,39 + ,85 + ,36 + ,87 + ,43 + ,75 + ,50 + ,103 + ,55 + ,86 + ,43 + ,77 + ,60 + ,74 + ,48 + ,74 + ,30 + ,76 + ,43 + ,83 + ,39 + ,101 + ,52 + ,83 + ,39 + ,92 + ,39 + ,74 + ,56 + ,87 + ,59 + ,71 + ,46 + ,79 + ,57 + ,83 + ,50 + ,80 + ,54 + ,90 + ,50 + ,80 + ,60 + ,96 + ,59 + ,109 + ,41 + ,98 + ,48 + ,85 + ,59 + ,83 + ,60 + ,86 + ,56 + ,72 + ,56 + ,83 + ,51 + ,75) + ,dim=c(2 + ,160) + ,dimnames=list(c('MC30VRB' + ,'MVRBIQ0') + ,1:160)) > y <- array(NA,dim=c(2,160),dimnames=list(c('MC30VRB','MVRBIQ0'),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] "MC30VRB" > (V2<-dimnames(y)[[1]][cat2]) [1] "MVRBIQ0" > 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) Treatment102 Treatment103 Treatment104 Treatment105 43.5000 10.5000 9.8333 19.1667 4.5000 Treatment107 Treatment109 Treatment110 Treatment111 Treatment63 8.5000 15.5000 6.5000 10.7500 1.0000 Treatment67 Treatment68 Treatment69 Treatment70 Treatment71 0.5000 0.5000 11.5000 -0.8333 10.3000 Treatment72 Treatment73 Treatment74 Treatment75 Treatment76 6.5000 -7.5000 1.2500 0.6667 3.7500 Treatment77 Treatment78 Treatment79 Treatment80 Treatment81 1.7857 0.1667 7.6667 5.3333 5.6429 Treatment82 Treatment83 Treatment84 Treatment85 Treatment86 0.8333 7.8750 1.5000 4.1667 10.6429 Treatment87 Treatment88 Treatment89 Treatment90 Treatment91 -2.5000 1.0000 1.9000 11.5000 8.8333 Treatment92 Treatment93 Treatment95 Treatment96 Treatment97 2.1667 3.5000 4.1667 7.0000 12.5000 Treatment98 Treatment99 -1.5000 3.1667 > (aov.xdf<-aov(lmxdf) ) Call: aov(formula = lmxdf) Terms: Treatment Residuals Sum of Squares 3130.374 8287.601 Deg. of Freedom 41 118 Residual standard error: 8.380567 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 41 3130.4 76.351 1.0871 0.3564 Residuals 118 8287.6 70.234 > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/www/rcomp/tmp/1til01322576939.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/www/rcomp/tmp/20an21322576939.tab") > postscript(file="/var/www/rcomp/tmp/36auy1322576939.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/www/rcomp/tmp/4t9m01322576939.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/www/rcomp/tmp/5x2wh1322576939.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/www/rcomp/tmp/6vsxn1322576939.tab") + } > library(car) Loading required package: MASS Loading required package: nnet Loading required package: survival Loading required package: splines > 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/www/rcomp/tmp/73cly1322576939.tab") > > try(system("convert tmp/36auy1322576939.ps tmp/36auy1322576939.png",intern=TRUE)) character(0) > try(system("convert tmp/4t9m01322576939.ps tmp/4t9m01322576939.png",intern=TRUE)) GPL Ghostscript GPL Ghostscript 8.648.64: : Unrecoverable error, exit code 1 Unrecoverable error, exit code 1 GPL Ghostscript GPL Ghostscript 8.648.64: : Unrecoverable error, exit code 1 Unrecoverable error, exit code 1 convert: Postscript delegate failed `tmp/4t9m01322576939.ps': No such file or directory @ coders/ps.c/ReadPSImage/736. convert: missing an image filename `tmp/4t9m01322576939.png' @ wand/convert.c/ConvertImageCommand/2710. [1] "Error: /rangecheck in --setdash--" [2] "Operand stack:" [3] " --nostringval-- 0" [4] "Execution stack:" [5] " %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1862 1 3 %oparray_pop 1861 1 3 %oparray_pop --nostringval-- 1845 1 3 %oparray_pop 1739 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- 1740 2 3 %oparray_pop" [6] "Dictionary stack:" [7] " --dict:1154/1684(ro)(G)-- --dict:0/20(G)-- --dict:97/200(L)--" [8] "Current allocation mode is local" [9] "Current file position is 55710" [10] "Error: /rangecheck in --setdash--" [11] "Operand stack:" [12] " --nostringval-- 0" [13] "Execution stack:" [14] " %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1862 1 3 %oparray_pop 1861 1 3 %oparray_pop --nostringval-- 1845 1 3 %oparray_pop 1739 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- 1740 2 3 %oparray_pop" [15] "Dictionary stack:" [16] " --dict:1154/1684(ro)(G)-- --dict:0/20(G)-- --dict:97/200(L)--" [17] "Current allocation mode is local" [18] "Current file position is 55710" Warning message: running command 'convert tmp/4t9m01322576939.ps tmp/4t9m01322576939.png' had status 1 > > > proc.time() user system elapsed 11.400 0.100 11.499