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(36 + ,1 + ,3 + ,36 + ,2 + ,6 + ,56 + ,2 + ,8 + ,48 + ,3 + ,8 + ,32 + ,1 + ,7 + ,44 + ,1 + ,5 + ,39 + ,2 + ,7 + ,34 + ,2 + ,8 + ,41 + ,1 + ,9 + ,50 + ,3 + ,9 + ,39 + ,1 + ,3 + ,62 + ,3 + ,9 + ,52 + ,2 + ,7 + ,37 + ,1 + ,9 + ,50 + ,2 + ,8 + ,41 + ,2 + ,6 + ,55 + ,2 + ,7 + ,41 + ,1 + ,8 + ,56 + ,3 + ,9 + ,39 + ,2 + ,7 + ,52 + ,1 + ,6 + ,46 + ,1 + ,8 + ,44 + ,1 + ,7 + ,48 + ,1 + ,7 + ,41 + ,2 + ,8 + ,50 + ,3 + ,9 + ,50 + ,2 + ,9 + ,44 + ,2 + ,7 + ,52 + ,2 + ,4 + ,54 + ,2 + ,7 + ,44 + ,2 + ,7 + ,52 + ,3 + ,9 + ,37 + ,2 + ,7 + ,52 + ,2 + ,9 + ,50 + ,2 + ,10 + ,36 + ,1 + ,5 + ,50 + ,2 + ,6 + ,52 + ,2 + ,9 + ,55 + ,3 + ,9 + ,31 + ,1 + ,8 + ,36 + ,2 + ,6 + ,49 + ,1 + ,6 + ,42 + ,2 + ,5 + ,37 + ,2 + ,8 + ,41 + ,2 + ,8 + ,30 + ,2 + ,5 + ,52 + ,2 + ,6 + ,30 + ,1 + ,9 + ,41 + ,1 + ,8 + ,44 + ,2 + ,4 + ,66 + ,2 + ,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,43 + ,3 + ,6 + ,44 + ,1 + ,7 + ,34 + ,2 + ,9 + ,30 + ,2 + ,6 + ,50 + ,2 + ,10 + ,39 + ,1 + ,4 + ,37 + ,2 + ,8 + ,55 + ,1 + ,7 + ,48 + ,3 + ,10 + ,39 + ,2 + ,5 + ,36 + ,2 + ,9 + ,43 + ,1 + ,8 + ,50 + ,3 + ,9 + ,55 + ,2 + ,8 + ,43 + ,1 + ,8 + ,60 + ,1 + ,9 + ,48 + ,1 + ,8 + ,30 + ,1 + ,9 + ,43 + ,2 + ,7 + ,39 + ,3 + ,6 + ,52 + ,2 + ,8 + ,39 + ,2 + ,6 + ,39 + ,1 + ,5 + ,56 + ,2 + ,3 + ,59 + ,1 + ,6 + ,46 + ,1 + ,8 + ,57 + ,2 + ,7 + ,50 + ,2 + ,8 + ,54 + ,2 + ,6 + ,50 + ,2 + ,9 + ,60 + ,3 + ,9 + ,59 + ,3 + ,10 + ,41 + ,3 + ,7 + ,48 + ,2 + ,5 + ,59 + ,2 + ,8 + ,60 + ,2 + ,9 + ,56 + ,1 + ,8 + ,56 + ,2 + ,8 + ,51 + ,1 + ,4) + ,dim=c(3 + ,158) + ,dimnames=list(c('MC30VRB' + ,'MVRBIQ0' + ,'MWARM30') + ,1:158)) > y <- array(NA,dim=c(3,158),dimnames=list(c('MC30VRB','MVRBIQ0','MWARM30'),1:158)) > 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) Treatment2 Treatment3 46.653 1.370 5.639 > (aov.xdf<-aov(lmxdf) ) Call: aov(formula = lmxdf) Terms: Treatment Residuals Sum of Squares 521.36 10644.01 Deg. of Freedom 2 155 Residual standard error: 8.2868 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 521.4 260.680 3.7961 0.02457 * Residuals 155 10644.0 68.671 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/1dyfh1352130521.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/wessaorg/rcomp/tmp/27ld11352130521.tab") > postscript(file="/var/wessaorg/rcomp/tmp/3w74f1352130521.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/wessaorg/rcomp/tmp/4ij121352130521.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/wessaorg/rcomp/tmp/5097c1352130521.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/wessaorg/rcomp/tmp/623n11352130521.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/wessaorg/rcomp/tmp/7ywen1352130521.tab") > > try(system("convert tmp/3w74f1352130521.ps tmp/3w74f1352130521.png",intern=TRUE)) character(0) > try(system("convert tmp/4ij121352130521.ps tmp/4ij121352130521.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.568 0.239 1.793