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 = '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] "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, data = xdf) Coefficients: (Intercept) Treatment101 Treatment102 Treatment111 Treatment115 47.000 -4.000 13.000 1.000 3.500 Treatment30 Treatment32 Treatment34 Treatment36 Treatment37 31.000 23.500 46.250 41.000 36.000 Treatment39 Treatment41 Treatment43 Treatment44 Treatment45 41.833 26.333 44.333 39.000 30.000 Treatment46 Treatment48 Treatment50 Treatment52 Treatment54 47.222 41.625 47.800 45.000 51.167 Treatment55 Treatment56 Treatment57 Treatment58 Treatment59 41.143 46.000 50.000 55.333 54.250 Treatment60 Treatment62 Treatment66 Treatment68 Treatment70 50.000 50.333 60.250 -3.500 -8.000 Treatment75 Treatment79 Treatment80 Treatment82 Treatment84 4.500 3.000 2.000 3.000 4.000 Treatment85 Treatment86 Treatment87 Treatment88 Treatment90 -8.000 -2.400 1.333 -3.000 1.000 Treatment91 Treatment92 Treatment94 Treatment95 Treatment96 0.500 3.000 -6.600 1.500 9.000 Treatment97 Treatment98 1.750 -2.000 > (aov.xdf<-aov(lmxdf) ) Call: aov(formula = lmxdf) Terms: Treatment Residuals Sum of Squares 77154.36 11945.65 Deg. of Freedom 46 109 Residual standard error: 10.46868 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 46 77154 1677.27 15.305 < 2.2e-16 *** Residuals 109 11946 109.59 --- 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/19sbj1352160166.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/2yjdb1352160167.tab") > postscript(file="/var/wessaorg/rcomp/tmp/3umh21352160167.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/4rn4w1352160167.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/5r1xq1352160167.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/6264w1352160167.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/7668l1352160167.tab") > > try(system("convert tmp/3umh21352160167.ps tmp/3umh21352160167.png",intern=TRUE)) character(0) > try(system("convert tmp/4rn4w1352160167.ps tmp/4rn4w1352160167.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 31.127 0.872 31.982