# ::Free Statistics and Forecasting Software::

v1.1.23-r6
Secure website (SSL) | Private

### :: One-Way-Between-Groups ANOVA- Free Statistics Software (Calculator) ::

All rights reserved. The non-commercial (academic) use of this software is free of charge. The only thing that is asked in return is to cite this software when results are used in publications.

This free online software (calculator) computes the One-Way-Between-Groups ANOVA, Levene's Test for Equality of Variances, and Tukey's HSD (Honestly Significant Difference) Test. This R module is used in Workshop 8 of the PY2224 statistics course at Aston University, UK.

Enter (or paste) a matrix (table) containing all data (time) series. Every column represents a different variable and must be delimited by a space or Tab. Every row represents a period in time (or category) and must be delimited by hard returns. The easiest way to enter data is to copy and paste a block of spreadsheet cells. Please, do not use commas or spaces to seperate groups of digits!

 Send output to: Browser Blue - Charts White Browser Black/White CSV MS Excel MS Word Data X: 0.175856683 'Control' -0.447651543 'Control' 1.189631467 'Control' 0.630458094 'Control' 0.799144649 'Control' -1.092828626 'Control' -1.238732879 'Control' 1.16725143 'Control' -0.113810912 'TreatA' 1.679383017 'TreatA' 2.436619868 'TreatA' 0.303840895 'TreatA' 2.087609483 'TreatA' 1.505986604 'TreatA' 0.514409262 'TreatA' 1.446292098 'TreatA' -0.234668772 'TreatB' 1.873012882 'TreatB' -0.229861698 'TreatB' -0.421339844 'TreatB' 2.09408266 'TreatB' -0.206760875 'TreatB' -1.821729039 'TreatB' 2.229756407 'TreatB' Names of X columns: Response Treatment Sample Range:(leave blank to include all observations) From: To: Response Variable (column number) Factor Variable (column number) Include Intercept Term ? FALSE TRUE Chart options Width: Height: Title: Label y-axis: Label x-axis:

 Source code of R module 1 cat1 <- as.numeric(par1) # 2 cat2<- as.numeric(par2) # 3 intercept<-as.logical(par3) 4 x <- t(x) 5 x1<-as.numeric(x[,cat1]) 6 f1<-as.character(x[,cat2]) 7 xdf<-data.frame(x1,f1) 8 (V1<-dimnames(y)[[1]][cat1]) 9 (V2<-dimnames(y)[[1]][cat2]) 10 names(xdf)<-c("Response", "Treatment") 11 if(intercept == FALSE) (lmxdf<-lm(Response ~ Treatment - 1, data = xdf) ) else (lmxdf<-lm(Response ~ Treatment, data = xdf) ) 12 (aov.xdf<-aov(lmxdf) ) 13 (anova.xdf<-anova(lmxdf) ) 14 load(file='createtable') 15 a<-table.start() 16 a<-table.row.start(a) 17 a<-table.element(a,'ANOVA Model', length(lmxdf\$coefficients)+1,TRUE) 18 a<-table.row.end(a) 19 a<-table.row.start(a) 20 a<-table.element(a, paste(V1, ' ~ ', V2), length(lmxdf\$coefficients)+1,TRUE) 21 a<-table.row.end(a) 22 a<-table.row.start(a) 23 a<-table.element(a, "means",,TRUE) 24 for(i in 1:length(lmxdf\$coefficients)){ 25 a<-table.element(a, round(lmxdf\$coefficients[i], digits=3),,FALSE) 26 } 27 a<-table.row.end(a) 28 a<-table.end(a) 29 table.save(a,file='mytable.tab') 30 a<-table.start() 31 a<-table.row.start(a) 32 a<-table.element(a,'ANOVA Statistics', 5+1,TRUE) 33 a<-table.row.end(a) 34 a<-table.row.start(a) 35 a<-table.element(a, " ",,TRUE) 36 a<-table.element(a, "Df",,FALSE) 37 a<-table.element(a, "Sum Sq",,FALSE) 38 a<-table.element(a, "Mean Sq",,FALSE) 39 a<-table.element(a, "F value",,FALSE) 40 a<-table.element(a, "Pr(>F)",,FALSE) 41 a<-table.row.end(a) 42 a<-table.row.start(a) 43 a<-table.element(a, V2,,TRUE) 44 a<-table.element(a, anova.xdf\$Df[1],,FALSE) 45 a<-table.element(a, round(anova.xdf\$"Sum Sq"[1], digits=3),,FALSE) 46 a<-table.element(a, round(anova.xdf\$"Mean Sq"[1], digits=3),,FALSE) 47 a<-table.element(a, round(anova.xdf\$"F value"[1], digits=3),,FALSE) 48 a<-table.element(a, round(anova.xdf\$"Pr(>F)"[1], digits=3),,FALSE) 49 a<-table.row.end(a) 50 a<-table.row.start(a) 51 a<-table.element(a, "Residuals",,TRUE) 52 a<-table.element(a, anova.xdf\$Df[2],,FALSE) 53 a<-table.element(a, round(anova.xdf\$"Sum Sq"[2], digits=3),,FALSE) 54 a<-table.element(a, round(anova.xdf\$"Mean Sq"[2], digits=3),,FALSE) 55 a<-table.element(a, " ",,FALSE) 56 a<-table.element(a, " ",,FALSE) 57 a<-table.row.end(a) 58 a<-table.end(a) 59 table.save(a,file='mytable1.tab') 60 bitmap(file='anovaplot.png') 61 boxplot(Response ~ Treatment, data=xdf, xlab=V2, ylab=V1) 62 dev.off() 63 if(intercept==TRUE){ 64 thsd<-TukeyHSD(aov.xdf) 65 bitmap(file='TukeyHSDPlot.png') 66 plot(thsd) 67 dev.off() 68 } 69 if(intercept==TRUE){ 70 a<-table.start() 71 a<-table.row.start(a) 72 a<-table.element(a,'Tukey Honest Significant Difference Comparisons', 5,TRUE) 73 a<-table.row.end(a) 74 a<-table.row.start(a) 75 a<-table.element(a, ' ', 1, TRUE) 76 for(i in 1:4){ 77 a<-table.element(a,colnames(thsd[[1]])[i], 1, TRUE) 78 } 79 a<-table.row.end(a) 80 for(i in 1:length(rownames(thsd[[1]]))){ 81 a<-table.row.start(a) 82 a<-table.element(a,rownames(thsd[[1]])[i], 1, TRUE) 83 for(j in 1:4){ 84 a<-table.element(a,round(thsd[[1]][i,j], digits=3), 1, FALSE) 85 } 86 a<-table.row.end(a) 87 } 88 a<-table.end(a) 89 table.save(a,file='mytable2.tab') 90 } 91 if(intercept==FALSE){ 92 a<-table.start() 93 a<-table.row.start(a) 94 a<-table.element(a,'TukeyHSD Message', 1,TRUE) 95 a<-table.row.end(a) 96 a<-table.start() 97 a<-table.row.start(a) 98 a<-table.element(a,'Must Include Intercept to use Tukey Test ', 1, FALSE) 99 a<-table.row.end(a) 100 a<-table.end(a) 101 table.save(a,file='mytable2.tab') 102 } 103 library(car) 104 lt.lmxdf<-levene.test(lmxdf) 105 a<-table.start() 106 a<-table.row.start(a) 107 a<-table.element(a,'Levenes Test for Homogeneity of Variance', 4,TRUE) 108 a<-table.row.end(a) 109 a<-table.row.start(a) 110 a<-table.element(a,' ', 1, TRUE) 111 for (i in 1:3){ 112 a<-table.element(a,names(lt.lmxdf)[i], 1, FALSE) 113 } 114 a<-table.row.end(a) 115 a<-table.row.start(a) 116 a<-table.element(a,'Group', 1, TRUE) 117 for (i in 1:3){ 118 a<-table.element(a,round(lt.lmxdf[[i]][1], digits=3), 1, FALSE) 119 } 120 a<-table.row.end(a) 121 a<-table.row.start(a) 122 a<-table.element(a,' ', 1, TRUE) 123 a<-table.element(a,lt.lmxdf[[1]][2], 1, FALSE) 124 a<-table.element(a,' ', 1, FALSE) 125 a<-table.element(a,' ', 1, FALSE) 126 a<-table.row.end(a) 127 a<-table.end(a) 128 table.save(a,file='mytable3.tab')
 Top | Output | Charts | References | History | Feedback

 Cite this software as: Ian E. Holliday, 2010, One-Way-Between-Groups ANOVA (v1.0.2) in Free Statistics Software (v1.1.23-r6), Office for Research Development and Education, URL http://www.wessa.net/Ian.Holliday/rwasp_One%20Factor%20ANOVA.wasp/ The R code is based on : NIST/SEMATECH e-Handbook of Statistical Methods: Levene Test for Equality of Variances, URL http://www.itl.nist.gov/div898/handbook/eda/section3/eda35a.htm NIST/SEMATECH e-Handbook of Statistical Methods: Tukey method, URL http://www.itl.nist.gov/div898/handbook/prc/section4/prc471.htm
 Top | Output | Charts | References | History | Feedback
 Top | Output | Charts | References | History | Feedback