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(88 + ,36 + ,94 + ,56 + ,90 + ,48 + ,73 + ,32 + ,68 + ,44 + ,80 + ,39 + ,86 + ,34 + ,86 + ,41 + ,91 + ,50 + ,79 + ,39 + ,96 + ,62 + ,92 + ,52 + ,72 + ,37 + ,96 + ,50 + ,70 + ,41 + ,86 + ,55 + ,87 + ,41 + ,88 + ,56 + ,79 + ,39 + ,90 + ,52 + ,95 + ,46 + ,85 + ,44 + ,48 + ,90 + ,41 + ,115 + ,50 + ,84 + ,50 + ,79 + ,44 + ,94 + ,52 + ,97 + ,54 + ,86 + ,44 + ,111 + ,52 + ,87 + ,37 + ,98 + ,52 + ,87 + ,50 + ,68 + ,36 + ,88 + ,50 + ,82 + ,52 + ,111 + ,55 + ,75 + ,31 + ,94 + ,36 + ,95 + ,49 + ,80 + ,42 + ,95 + ,37 + ,68 + ,41 + ,94 + ,30 + ,88 + ,52 + ,84 + ,30 + ,41 + ,101 + ,44 + ,98 + ,66 + ,78 + ,48 + ,109 + ,43 + ,102 + ,57 + ,81 + ,46 + ,97 + ,54 + ,75 + ,48 + ,97 + ,48 + ,101 + ,62 + ,101 + ,58 + ,95 + ,58 + ,95 + ,62 + ,95 + ,46 + ,90 + ,34 + ,107 + ,66 + ,92 + ,52 + ,86 + ,55 + ,70 + ,55 + ,95 + ,57 + ,96 + ,56 + ,91 + ,55 + ,87 + ,56 + ,92 + ,54 + ,97 + ,55 + ,102 + ,46 + ,91 + ,52 + ,68 + ,32 + ,88 + ,44 + ,97 + ,46 + ,90 + ,59 + ,101 + ,46 + ,94 + ,46 + ,101 + ,54 + ,109 + ,66 + ,100 + ,56 + ,103 + ,59 + ,94 + ,57 + ,97 + ,52 + ,85 + ,48 + ,75 + ,44 + ,77 + ,41 + ,87 + ,50 + ,78 + ,48 + ,108 + ,48 + ,97 + ,59 + ,105 + ,34 + ,106 + ,46 + ,107 + ,54 + ,95 + ,55 + ,107 + ,54 + ,115 + ,59 + ,101 + ,44 + ,85 + ,54 + ,90 + ,52 + ,115 + ,66 + ,95 + ,44 + ,97 + ,57 + ,112 + ,39 + ,97 + ,60 + ,77 + ,45 + ,90 + ,41 + ,94 + ,50 + ,103 + ,39 + ,77 + ,43 + ,98 + ,48 + ,90 + ,37 + ,111 + ,58 + ,77 + ,46 + ,88 + ,43 + ,75 + ,44 + ,92 + ,34 + ,78 + ,30 + ,106 + ,50 + ,80 + ,39 + ,87 + ,37 + ,92 + ,55 + ,48 + ,111 + ,41 + ,86 + ,39 + ,85 + ,36 + ,90 + ,43 + ,101 + ,50 + ,94 + ,55 + ,86 + ,43 + ,86 + ,60 + ,90 + ,48 + ,75 + ,30 + ,86 + ,43 + ,91 + ,39 + ,97 + ,52 + ,91 + ,39 + ,70 + ,39 + ,98 + ,56 + ,96 + ,59 + ,95 + ,46 + ,100 + ,57 + ,95 + ,50 + ,97 + ,54 + ,97 + ,50 + ,92 + ,60 + ,115 + ,59 + ,88 + ,41 + ,87 + ,48 + ,100 + ,59 + ,98 + ,60 + ,102 + ,56 + ,96 + ,51) + ,dim=c(2 + ,156) + ,dimnames=list(c('WISCRY7V' + ,'MC30VRB') + ,1:156)) > y <- array(NA,dim=c(2,156),dimnames=list(c('WISCRY7V','MC30VRB'),1:156)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'FALSE' > 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] "WISCRY7V" > (V2<-dimnames(y)[[1]][cat2]) [1] "MC30VRB" > 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 - 1, data = xdf) Coefficients: Treatment100 Treatment101 Treatment102 Treatment111 Treatment115 47.00 43.00 60.00 48.00 50.50 Treatment30 Treatment32 Treatment34 Treatment36 Treatment37 78.00 70.50 93.25 88.00 83.00 Treatment39 Treatment41 Treatment43 Treatment44 Treatment45 88.83 73.33 91.33 86.00 77.00 Treatment46 Treatment48 Treatment50 Treatment52 Treatment54 94.22 88.62 94.80 92.00 98.17 Treatment55 Treatment56 Treatment57 Treatment58 Treatment59 88.14 93.00 97.00 102.33 101.25 Treatment60 Treatment62 Treatment66 Treatment68 Treatment70 97.00 97.33 107.25 43.50 39.00 Treatment75 Treatment79 Treatment80 Treatment82 Treatment84 51.50 50.00 49.00 50.00 51.00 Treatment85 Treatment86 Treatment87 Treatment88 Treatment90 39.00 44.60 48.33 44.00 48.00 Treatment91 Treatment92 Treatment94 Treatment95 Treatment96 47.50 50.00 40.40 48.50 56.00 Treatment97 Treatment98 48.75 45.00 > (aov.xdf<-aov(lmxdf) ) Call: aov(formula = lmxdf) Terms: Treatment Residuals Sum of Squares 961417.3 11945.7 Deg. of Freedom 47 109 Residual standard error: 10.46868 Estimated effects are balanced > (anova.xdf<-anova(lmxdf) ) Analysis of Variance Table Response: Response Df Sum Sq Mean Sq F value Pr(>F) Treatment 47 961417 20455.7 186.65 < 2.2e-16 *** Residuals 109 11946 109.6 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > > #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/12sl91352160887.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/2v5x41352160887.tab") > postscript(file="/var/fisher/rcomp/tmp/388sb1352160887.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/4vgmz1352160887.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(thsd) + dev.off() + } > 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/5atnm1352160887.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/6z4la1352160887.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/71lqr1352160887.tab") > > try(system("convert tmp/388sb1352160887.ps tmp/388sb1352160887.png",intern=TRUE)) character(0) > try(system("convert tmp/4vgmz1352160887.ps tmp/4vgmz1352160887.png",intern=TRUE)) convert: unable to open image `tmp/4vgmz1352160887.ps': @ error/blob.c/OpenBlob/2587. convert: missing an image filename `tmp/4vgmz1352160887.png' @ error/convert.c/ConvertImageCommand/3011. character(0) attr(,"status") [1] 1 Warning message: running command 'convert tmp/4vgmz1352160887.ps tmp/4vgmz1352160887.png' had status 1 > > > proc.time() user system elapsed 1.104 0.231 1.321