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(86 + ,88 + ,86 + ,94 + ,103 + ,90 + ,74 + ,73 + ,63 + ,68 + ,82 + ,80 + ,93 + ,86 + ,77 + ,86 + ,111 + ,91 + ,71 + ,79 + ,103 + ,96 + ,89 + ,92 + ,75 + ,72 + ,88 + ,96 + ,84 + ,70 + ,85 + ,86 + ,70 + ,87 + ,104 + ,88 + ,88 + ,79 + ,77 + ,90 + ,77 + ,95 + ,72 + ,85 + ,83 + ,90 + ,110 + ,115 + ,91 + ,84 + ,80 + ,79 + ,91 + ,94 + ,86 + ,97 + ,85 + ,86 + ,107 + ,111 + ,93 + ,87 + ,87 + ,98 + ,84 + ,87 + ,73 + ,68 + ,84 + ,88 + ,86 + ,82 + ,99 + ,111 + ,75 + ,75 + ,87 + ,94 + ,79 + ,95 + ,82 + ,80 + ,95 + ,95 + ,84 + ,68 + ,85 + ,94 + ,95 + ,88 + ,63 + ,84 + ,85 + ,101 + ,86 + ,98 + ,75 + ,78 + ,98 + ,109 + ,71 + ,102 + ,63 + ,81 + ,71 + ,97 + ,84 + ,75 + ,81 + ,97 + ,79 + ,101 + ,63 + ,101 + ,93 + ,95 + ,92 + ,95 + ,83 + ,95 + ,80 + ,90 + ,111 + ,107 + ,92 + ,92 + ,79 + ,86 + ,69 + ,70 + ,83 + ,95 + ,80 + ,96 + ,91 + ,91 + ,97 + ,87 + ,85 + ,92 + ,85 + ,97 + ,99 + ,102 + ,67 + ,91 + ,87 + ,68 + ,68 + ,88 + ,81 + ,97 + ,80 + ,90 + ,93 + ,101 + ,93 + ,94 + ,102 + ,101 + ,104 + ,109 + ,90 + ,100 + ,85 + ,103 + ,92 + ,94 + ,82 + ,97 + ,85 + ,85 + ,89 + ,75 + ,77 + ,77 + ,79 + ,87 + ,76 + ,78 + ,101 + ,108 + ,81 + ,97 + ,89 + ,106 + ,81 + ,107 + ,77 + ,95 + ,95 + ,107 + ,85 + ,115 + ,81 + ,101 + ,76 + ,85 + ,93 + ,90 + ,104 + ,115 + ,89 + ,95 + ,76 + ,97 + ,77 + ,112 + ,71 + ,97 + ,79 + ,77 + ,89 + ,90 + ,81 + ,94 + ,99 + ,103 + ,81 + ,77 + ,84 + ,98 + ,85 + ,90 + ,111 + ,111 + ,78 + ,77 + ,111 + ,88 + ,78 + ,75 + ,87 + ,92 + ,92 + ,78 + ,93 + ,106 + ,70 + ,80 + ,84 + ,87 + ,75 + ,92 + ,85 + ,86 + ,87 + ,85 + ,75 + ,90 + ,103 + ,101 + ,86 + ,94 + ,77 + ,86 + ,74 + ,86 + ,74 + ,90 + ,76 + ,75 + ,83 + ,86 + ,101 + ,91 + ,83 + ,97 + ,92 + ,91 + ,74 + ,70 + ,87 + ,98 + ,71 + ,96 + ,79 + ,95 + ,83 + ,100 + ,80 + ,95 + ,90 + ,97 + ,80 + ,97 + ,96 + ,92 + ,109 + ,115 + ,98 + ,88 + ,85 + ,87 + ,83 + ,100 + ,86 + ,98 + ,72 + ,102 + ,75 + ,96) + ,dim=c(2 + ,151) + ,dimnames=list(c('MVRBQIQ0' + ,'WISCRY7V') + ,1:151)) > y <- array(NA,dim=c(2,151),dimnames=list(c('MVRBQIQ0','WISCRY7V'),1:151)) > 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] "MVRBQIQ0" > (V2<-dimnames(y)[[1]][cat2]) [1] "WISCRY7V" > 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) Treatment101 Treatment102 Treatment103 Treatment106 85.3333 1.2381 -4.6667 6.6667 5.6667 Treatment107 Treatment108 Treatment109 Treatment111 Treatment112 10.3333 15.6667 15.6667 20.3333 -8.3333 Treatment115 Treatment68 Treatment70 Treatment72 Treatment73 16.6667 -8.5833 -9.6667 -10.3333 -11.3333 Treatment75 Treatment77 Treatment78 Treatment79 Treatment80 -4.9333 -6.5833 -4.3333 -5.6667 -7.3333 Treatment81 Treatment82 Treatment84 Treatment85 Treatment86 -22.3333 0.6667 -8.3333 -5.3333 -3.3333 Treatment87 Treatment88 Treatment90 Treatment91 Treatment92 -0.7619 6.9524 -1.4333 7.0667 2.0000 Treatment94 Treatment95 Treatment96 Treatment97 Treatment98 2.2917 -1.0606 -1.9333 -4.7500 0.6667 > (aov.xdf<-aov(lmxdf) ) Call: aov(formula = lmxdf) Terms: Treatment Residuals Sum of Squares 6949.300 9977.164 Deg. of Freedom 34 116 Residual standard error: 9.27416 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 34 6949.3 204.39 2.3764 0.0003387 *** Residuals 116 9977.2 86.01 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > > #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/1ahu11322479571.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/2tp2j1322479571.tab") > postscript(file="/var/www/rcomp/tmp/3ysqf1322479571.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/490qp1322479571.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/5n8ax1322479571.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/6ausp1322479571.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/7tozc1322479571.tab") > > try(system("convert tmp/3ysqf1322479571.ps tmp/3ysqf1322479571.png",intern=TRUE)) character(0) > try(system("convert tmp/490qp1322479571.ps tmp/490qp1322479571.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/490qp1322479571.ps': No such file or directory @ coders/ps.c/ReadPSImage/736. convert: missing an image filename `tmp/490qp1322479571.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 39299" [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 39299" Warning message: running command 'convert tmp/490qp1322479571.ps tmp/490qp1322479571.png' had status 1 > > > proc.time() user system elapsed 6.130 0.090 6.216