R version 2.13.0 (2011-04-13) Copyright (C) 2011 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(1 + ,36 + ,88 + ,3 + ,56 + ,94 + ,3 + ,48 + ,90 + ,3 + ,32 + ,73 + ,1 + ,44 + ,68 + ,2 + ,39 + ,80 + ,3 + ,34 + ,86 + ,3 + ,41 + ,86 + ,2 + ,50 + ,91 + ,1 + ,39 + ,79 + ,1 + ,62 + ,96 + ,3 + ,52 + ,92 + ,3 + ,37 + ,72 + ,3 + ,50 + ,96 + ,1 + ,41 + ,70 + ,3 + ,55 + ,86 + ,3 + ,41 + ,87 + ,3 + ,56 + ,88 + ,2 + ,39 + ,79 + ,2 + ,52 + ,90 + ,1 + ,46 + ,95 + ,1 + ,44 + ,85 + ,3 + ,41 + ,90 + ,1 + ,50 + ,115 + ,1 + ,50 + ,84 + ,3 + ,44 + ,79 + ,1 + ,52 + ,94 + ,2 + ,54 + ,97 + ,3 + ,44 + ,86 + ,2 + ,52 + ,111 + ,2 + ,37 + ,87 + ,3 + ,52 + ,98 + ,1 + ,50 + ,87 + ,3 + ,36 + ,68 + ,3 + ,50 + ,88 + ,1 + ,52 + ,82 + ,2 + ,55 + ,111 + ,1 + ,31 + ,75 + ,1 + ,36 + ,94 + ,2 + ,49 + ,95 + ,1 + ,42 + ,80 + ,1 + ,37 + ,95 + ,3 + ,41 + ,68 + ,2 + ,30 + ,94 + ,2 + ,52 + ,88 + ,1 + ,30 + ,84 + ,1 + ,41 + ,1 + ,44 + ,101 + ,1 + ,66 + ,98 + ,2 + ,48 + ,78 + ,3 + ,43 + ,109 + ,3 + ,57 + ,102 + ,3 + ,46 + ,81 + ,3 + ,54 + ,97 + ,2 + ,48 + ,75 + ,2 + ,48 + ,97 + ,3 + ,62 + ,101 + ,3 + ,58 + ,101 + ,2 + ,58 + ,95 + ,2 + ,62 + ,95 + ,3 + ,46 + ,95 + ,2 + ,34 + ,90 + ,3 + ,66 + ,107 + ,3 + ,52 + ,92 + ,2 + ,55 + ,86 + ,2 + ,55 + ,70 + ,3 + ,57 + ,95 + ,3 + ,56 + ,96 + ,2 + ,55 + ,91 + ,1 + ,56 + ,87 + ,2 + ,54 + ,92 + ,2 + ,55 + ,97 + ,2 + ,46 + ,102 + ,2 + ,52 + ,91 + ,3 + ,32 + ,68 + ,2 + ,44 + ,88 + ,3 + ,46 + ,97 + ,1 + ,59 + ,90 + ,3 + ,46 + ,101 + ,3 + ,46 + ,94 + ,1 + ,54 + ,101 + ,1 + ,66 + ,109 + ,2 + ,56 + ,100 + ,1 + ,59 + ,103 + ,3 + ,57 + ,94 + ,1 + ,52 + ,97 + ,3 + ,48 + ,85 + ,2 + ,44 + ,75 + ,3 + ,41 + ,77 + ,1 + ,50 + ,87 + ,1 + ,48 + ,78 + ,2 + ,48 + ,108 + ,3 + ,59 + ,97 + ,1 + ,34 + ,105 + ,3 + ,46 + ,106 + ,1 + ,54 + ,107 + ,2 + ,55 + ,95 + ,2 + ,54 + ,107 + ,3 + ,59 + ,115 + ,3 + ,44 + ,101 + ,1 + ,54 + ,85 + ,3 + ,52 + ,90 + ,3 + ,66 + ,115 + ,3 + ,44 + ,95 + ,2 + ,57 + ,97 + ,3 + ,39 + ,112 + ,3 + ,60 + ,97 + ,3 + ,45 + ,77 + ,3 + ,41 + ,90 + ,1 + ,50 + ,94 + ,3 + ,39 + ,103 + ,1 + ,43 + ,77 + ,3 + ,48 + ,98 + ,3 + ,37 + ,90 + ,3 + ,58 + ,111 + ,2 + ,46 + ,77 + ,3 + ,43 + ,88 + ,2 + ,44 + ,75 + ,3 + ,34 + ,92 + ,2 + ,30 + ,78 + ,2 + ,50 + ,106 + ,2 + ,39 + ,80 + ,3 + ,37 + ,87 + ,3 + ,55 + ,92 + ,1 + ,41 + ,111 + ,3 + ,39 + ,86 + ,3 + ,36 + ,85 + ,2 + ,43 + ,90 + ,1 + ,50 + ,101 + ,3 + ,55 + ,94 + ,3 + ,43 + ,86 + ,3 + ,60 + ,86 + ,2 + ,48 + ,90 + ,1 + ,30 + ,75 + ,3 + ,43 + ,86 + ,3 + ,39 + ,91 + ,3 + ,52 + ,97 + ,2 + ,39 + ,91 + ,3 + ,39 + ,70 + ,2 + ,56 + ,98 + ,3 + ,59 + ,96 + ,3 + ,46 + ,95 + ,2 + ,57 + ,100 + ,3 + ,50 + ,95 + ,3 + ,54 + ,97 + ,3 + ,50 + ,97 + ,3 + ,60 + ,92 + ,1 + ,59 + ,115 + ,3 + ,41 + ,88 + ,2 + ,48 + ,87 + ,3 + ,59 + ,100 + ,3 + ,60 + ,98 + ,1 + ,56 + ,102 + ,3 + ,51 + ,96) + ,dim=c(3 + ,154) + ,dimnames=list(c('MOMAGE' + ,'MC30VRB' + ,'WISCRY7V') + ,1:154)) > y <- array(NA,dim=c(3,154),dimnames=list(c('MOMAGE','MC30VRB','WISCRY7V'),1:154)) > 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 = '1' > par1 = '2' > 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] "MOMAGE" > 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 Treatment30 Treatment32 Treatment34 43.500 2.773 1.500 33.000 24.500 52.167 Treatment36 Treatment37 Treatment39 Treatment41 Treatment43 Treatment44 41.500 45.000 46.929 48.000 45.833 45.667 Treatment45 Treatment46 Treatment48 Treatment50 Treatment51 Treatment52 33.500 50.722 44.944 53.167 52.500 49.900 Treatment54 Treatment55 Treatment56 Treatment57 Treatment58 Treatment59 54.500 45.786 53.100 54.100 58.833 58.786 Treatment60 Treatment62 Treatment66 49.750 54.500 63.750 > (aov.xdf<-aov(lmxdf) ) Call: aov(formula = lmxdf) Terms: Treatment Residuals Sum of Squares 82028.94 10000.96 Deg. of Freedom 26 127 Residual standard error: 8.873993 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 26 82029 3154.96 40.064 < 2.2e-16 *** Residuals 127 10001 78.75 --- 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/1qh1d1322140399.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/25bbf1322140399.tab") > postscript(file="/var/wessaorg/rcomp/tmp/3r9691322140399.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/4dcv91322140399.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/5yfg41322140399.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/6wp4k1322140399.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/wessaorg/rcomp/tmp/72jvq1322140399.tab") > > try(system("convert tmp/3r9691322140399.ps tmp/3r9691322140399.png",intern=TRUE)) character(0) > try(system("convert tmp/4dcv91322140399.ps tmp/4dcv91322140399.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.624 0.170 3.832