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(77 + ,77 + ,58 + ,51 + ,53 + ,54 + ,68 + ,70 + ,59 + ,59 + ,76 + ,76 + ,76 + ,77 + ,69 + ,73 + ,71 + ,71 + ,65 + ,64 + ,70 + ,75 + ,166 + ,56 + ,51 + ,52 + ,64 + ,64 + ,52 + ,57 + ,65 + ,66 + ,92 + ,101 + ,62 + ,62 + ,76 + ,75 + ,61 + ,61 + ,119 + ,124 + ,61 + ,61 + ,65 + ,66 + ,66 + ,70 + ,54 + ,59 + ,50 + ,50 + ,63 + ,61 + ,58 + ,60 + ,39 + ,41 + ,101 + ,100 + ,71 + ,71 + ,75 + ,73 + ,79 + ,76 + ,52 + ,52 + ,68 + ,63 + ,64 + ,65 + ,56 + ,54 + ,69 + ,69 + ,88 + ,86 + ,65 + ,67 + ,54 + ,53 + ,80 + ,80 + ,63 + ,59 + ,78 + ,80 + ,85 + ,82 + ,54 + ,55 + ,73 + ,NA + ,49 + ,NA + ,54 + ,56 + ,75 + ,75 + ,82 + ,85 + ,56 + ,57 + ,74 + ,73 + ,102 + ,107 + ,64 + ,NA + ,65 + ,64 + ,66 + ,65 + ,73 + ,74 + ,75 + ,70 + ,57 + ,58 + ,68 + ,69 + ,71 + ,71 + ,71 + ,76 + ,78 + ,75 + ,97 + ,98 + ,60 + ,59 + ,64 + ,63 + ,64 + ,62 + ,52 + ,51 + ,80 + ,76 + ,62 + ,61 + ,66 + ,66 + ,55 + ,54 + ,56 + ,57 + ,50 + ,50 + ,50 + ,NA + ,50 + ,55 + ,63 + ,64 + ,69 + ,70 + ,69 + ,70 + ,61 + ,60 + ,55 + ,56 + ,53 + ,52 + ,60 + ,55 + ,56 + ,56 + ,59 + ,61 + ,62 + ,66 + ,53 + ,53 + ,57 + ,59 + ,57 + ,56 + ,70 + ,68 + ,56 + ,56 + ,84 + ,86 + ,69 + ,71 + ,88 + ,87 + ,56 + ,57 + ,103 + ,101 + ,50 + ,50 + ,52 + ,52 + ,55 + ,NA + ,55 + ,55 + ,63 + ,63 + ,47 + ,47 + ,45 + ,45 + ,62 + ,63 + ,53 + ,51 + ,52 + ,51 + ,57 + ,55 + ,64 + ,64 + ,59 + ,55 + ,84 + ,90 + ,79 + ,79 + ,55 + ,57 + ,67 + ,67 + ,76 + ,77 + ,62 + ,62 + ,83 + ,83 + ,96 + ,94 + ,75 + ,76 + ,65 + ,66 + ,78 + ,77 + ,69 + ,73 + ,68 + ,68 + ,55 + ,55 + ,67 + ,NA + ,52 + ,56 + ,47 + ,NA + ,45 + ,45 + ,68 + ,68 + ,44 + ,44 + ,62 + ,61 + ,87 + ,89 + ,56 + ,53 + ,50 + ,47 + ,83 + ,84 + ,53 + ,53 + ,64 + ,62 + ,62 + ,NA + ,90 + ,91 + ,85 + ,83 + ,66 + ,68 + ,52 + ,53 + ,53 + ,55 + ,54 + ,55 + ,64 + ,66 + ,55 + ,55 + ,55 + ,55 + ,59 + ,55 + ,70 + ,67 + ,88 + ,86 + ,57 + ,58 + ,47 + ,47 + ,47 + ,45 + ,55 + ,NA + ,48 + ,44 + ,54 + ,58 + ,69 + ,68 + ,59 + ,NA + ,58 + ,NA + ,57 + ,56 + ,51 + ,50 + ,54 + ,54 + ,53 + ,52 + ,59 + ,58 + ,56 + ,58 + ,59 + ,59 + ,63 + ,62 + ,66 + ,66 + ,96 + ,95 + ,53 + ,50 + ,76 + ,75 + ,54 + ,NA + ,61 + ,61 + ,82 + ,NA + ,62 + ,64 + ,71 + ,68 + ,60 + ,NA + ,66 + ,67 + ,81 + ,82 + ,68 + ,68 + ,80 + ,78 + ,43 + ,NA + ,82 + ,NA + ,63 + ,59 + ,70 + ,70 + ,56 + ,56 + ,60 + ,55 + ,58 + ,54 + ,76 + ,75 + ,50 + ,49 + ,88 + ,93 + ,89 + ,86 + ,59 + ,59 + ,51 + ,51 + ,62 + ,61 + ,74 + ,71 + ,83 + ,80 + ,81 + ,NA + ,90 + ,91 + ,79 + ,81) + ,dim=c(2 + ,200) + ,dimnames=list(c('weightloss' + ,'rptwloss') + ,1:200)) > y <- array(NA,dim=c(2,200),dimnames=list(c('weightloss','rptwloss'),1:200)) > 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' > par3 <- 'FALSE' > par2 <- '2' > par1 <- '1' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: aston2 > #To cite this work: Ian E. Holliday, 2012, One-Way-Between-Groups ANOVA (v1.0.4) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/Ian.Holliday/rwasp_One%20Factor%20ANOVA.wasp/ > #Source of accompanying publication: > # > 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] "weightloss" > (V2<-dimnames(y)[[1]][cat2]) [1] "rptwloss" > 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 Treatment107 Treatment124 Treatment41 101.00 97.50 102.00 119.00 39.00 Treatment44 Treatment45 Treatment47 Treatment49 Treatment50 46.00 45.67 48.00 50.00 50.80 Treatment51 Treatment52 Treatment53 Treatment54 Treatment55 53.20 52.20 53.60 55.20 55.85 Treatment56 Treatment57 Treatment58 Treatment59 Treatment60 67.67 55.00 56.60 59.25 59.50 Treatment61 Treatment62 Treatment63 Treatment64 Treatment65 61.38 63.00 64.25 63.83 65.00 Treatment66 Treatment67 Treatment68 Treatment69 Treatment70 64.71 67.00 68.57 68.50 69.50 Treatment71 Treatment73 Treatment74 Treatment75 Treatment76 71.20 71.75 73.00 75.17 76.20 Treatment77 Treatment78 Treatment79 Treatment80 Treatment81 76.75 80.00 79.00 80.33 79.00 Treatment82 Treatment83 Treatment84 Treatment85 Treatment86 83.00 84.00 83.00 82.00 87.25 Treatment87 Treatment89 Treatment90 Treatment91 Treatment93 88.00 87.00 84.00 90.00 88.00 Treatment94 Treatment95 Treatment98 TreatmentNA 96.00 96.00 97.00 61.24 > (aov.xdf<-aov(lmxdf) ) Call: aov(formula = lmxdf) Terms: Treatment Residuals Sum of Squares 897340.5 13931.5 Deg. of Freedom 54 146 Residual standard error: 9.768368 Estimated effects are balanced > (anova.xdf<-anova(lmxdf) ) Analysis of Variance Table Response: Response Df Sum Sq Mean Sq F value Pr(>F) Treatment 54 897341 16617.4 174.15 < 2.2e-16 *** Residuals 146 13931 95.4 --- 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/1cifa1338546488.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/2h7yf1338546488.tab") > postscript(file="/var/wessaorg/rcomp/tmp/3erjw1338546488.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){ + 'Tukey Plot' + thsd<-TukeyHSD(aov.xdf) + postscript(file="/var/wessaorg/rcomp/tmp/4hjn41338546488.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/wessaorg/rcomp/tmp/5ni3t1338546488.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/6oe2s1338546488.tab") + } > library(car) Loading required package: MASS Loading required package: nnet Loading required package: survival Loading required package: splines > lt.lmxdf<-leveneTest(lmxdf) > 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/7luws1338546488.tab") > > try(system("convert tmp/3erjw1338546488.ps tmp/3erjw1338546488.png",intern=TRUE)) character(0) > try(system("convert tmp/4hjn41338546488.ps tmp/4hjn41338546488.png",intern=TRUE)) convert: unable to open image `tmp/4hjn41338546488.ps': No such file or directory @ blob.c/OpenBlob/2480. convert: missing an image filename `tmp/4hjn41338546488.png' @ convert.c/ConvertImageCommand/2838. character(0) Warning message: running command 'convert tmp/4hjn41338546488.ps tmp/4hjn41338546488.png' had status 1 > > > proc.time() user system elapsed 0.839 0.161 0.992