R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(86 + ,36 + ,88 + ,86 + ,56 + ,94 + ,103 + ,48 + ,90 + ,74 + ,32 + ,73 + ,63 + ,44 + ,68 + ,82 + ,39 + ,80 + ,93 + ,34 + ,86 + ,77 + ,41 + ,86 + ,111 + ,50 + ,91 + ,71 + ,39 + ,79 + ,103 + ,62 + ,96 + ,89 + ,52 + ,92 + ,75 + ,37 + ,72 + ,88 + ,50 + ,96 + ,84 + ,41 + ,70 + ,85 + ,55 + ,86 + ,70 + ,41 + ,87 + ,104 + ,56 + ,88 + ,88 + ,39 + ,79 + ,77 + ,52 + ,90 + ,77 + ,46 + ,95 + ,72 + ,44 + ,85 + ,83 + ,41 + ,90 + ,110 + ,50 + ,115 + ,91 + ,50 + ,84 + ,80 + ,44 + ,79 + ,91 + ,52 + ,94 + ,86 + ,54 + ,97 + ,85 + ,44 + ,86 + ,107 + ,52 + ,111 + ,93 + ,37 + ,87 + ,87 + ,52 + ,98 + ,84 + ,50 + ,87 + ,73 + ,36 + ,68 + ,84 + ,50 + ,88 + ,86 + ,52 + ,82 + ,99 + ,55 + ,111 + ,75 + ,31 + ,75 + ,87 + ,36 + ,94 + ,79 + ,49 + ,95 + ,82 + ,42 + ,80 + ,95 + ,37 + ,95 + ,84 + ,41 + ,68 + ,85 + ,30 + ,94 + ,95 + ,52 + ,88 + ,63 + ,30 + ,84 + ,85 + ,44 + ,101 + ,86 + ,66 + ,98 + ,75 + ,48 + ,78 + ,98 + ,43 + ,109 + ,71 + ,57 + ,102 + ,63 + ,46 + ,81 + ,71 + ,54 + ,97 + ,84 + ,48 + ,75 + ,81 + ,48 + ,97 + ,79 + ,62 + ,101 + ,63 + ,58 + ,101 + ,93 + ,58 + ,95 + ,92 + ,62 + ,95 + ,83 + ,46 + ,95 + ,80 + ,34 + ,90 + ,111 + ,66 + ,107 + ,92 + ,52 + ,92 + ,79 + ,55 + ,86 + ,69 + ,55 + ,70 + ,83 + ,57 + ,95 + ,80 + ,56 + ,96 + ,91 + ,55 + ,91 + ,97 + ,56 + ,87 + ,85 + ,54 + ,92 + ,85 + ,55 + ,97 + ,99 + ,46 + ,102 + ,67 + ,52 + ,91 + ,87 + ,32 + ,68 + ,68 + ,44 + ,88 + ,81 + ,46 + ,97 + ,80 + ,59 + ,90 + ,93 + ,46 + ,101 + ,93 + ,46 + ,94 + ,102 + ,54 + ,101 + ,104 + ,66 + ,109 + ,90 + ,56 + ,100 + ,85 + ,59 + ,103 + ,92 + ,57 + ,94 + ,82 + ,52 + ,97 + ,85 + ,48 + ,85 + ,89 + ,44 + ,75 + ,77 + ,41 + ,77 + ,79 + ,50 + ,87 + ,76 + ,48 + ,78 + ,101 + ,48 + ,108 + ,81 + ,59 + ,97 + ,92 + ,34 + ,105 + ,89 + ,46 + ,106 + ,81 + ,54 + ,107 + ,77 + ,55 + ,95 + ,95 + ,54 + ,107 + ,85 + ,59 + ,115 + ,81 + ,44 + ,101 + ,76 + ,54 + ,85 + ,93 + ,52 + ,90 + ,104 + ,66 + ,115 + ,89 + ,44 + ,95 + ,76 + ,57 + ,97 + ,77 + ,39 + ,112 + ,71 + ,60 + ,97 + ,79 + ,45 + ,77 + ,89 + ,41 + ,90 + ,81 + ,50 + ,94 + ,99 + ,39 + ,103 + ,81 + ,43 + ,77 + ,84 + ,48 + ,98 + ,85 + ,37 + ,90 + ,111 + ,58 + ,111 + ,78 + ,46 + ,77 + ,111 + ,43 + ,88 + ,78 + ,44 + ,75 + ,87 + ,34 + ,92 + ,92 + ,30 + ,78 + ,93 + ,50 + ,106 + ,70 + ,39 + ,80 + ,84 + ,37 + ,87 + ,75 + ,55 + ,92 + ,96 + ,41 + ,111 + ,85 + ,39 + ,86 + ,87 + ,36 + ,85 + ,75 + ,43 + ,90 + ,103 + ,50 + ,101 + ,86 + ,55 + ,94 + ,77 + ,43 + ,86 + ,74 + ,60 + ,86 + ,74 + ,48 + ,90 + ,76 + ,30 + ,75 + ,83 + ,43 + ,86 + ,101 + ,39 + ,91 + ,83 + ,52 + ,97 + ,92 + ,39 + ,91 + ,74 + ,39 + ,70 + ,87 + ,56 + ,98 + ,71 + ,59 + ,96 + ,79 + ,46 + ,95 + ,83 + ,57 + ,100 + ,80 + ,50 + ,95 + ,90 + ,54 + ,97 + ,80 + ,50 + ,97 + ,96 + ,60 + ,92 + ,109 + ,59 + ,115 + ,98 + ,41 + ,88 + ,85 + ,48 + ,87 + ,83 + ,59 + ,100 + ,86 + ,60 + ,98 + ,72 + ,56 + ,102 + ,75 + ,51 + ,96) + ,dim=c(3 + ,153) + ,dimnames=list(c('MVRBIQ0' + ,'MC30VRB' + ,'WISCRY7V') + ,1:153)) > y <- array(NA,dim=c(3,153),dimnames=list(c('MVRBIQ0','MC30VRB','WISCRY7V'),1:153)) > 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' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2009, STARS Bullying Study (v1.0.1) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/Ian.Holliday/rwasp_STARS_Bullying_Study_alt.wasp/ > #Source of accompanying publication: > #Technical description: > 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] "MVRBIQ0" > (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) Treatment31 Treatment32 Treatment34 Treatment36 Treatment37 7.900e+01 -4.000e+00 1.500e+00 9.000e+00 4.250e+00 7.400e+00 Treatment39 Treatment41 Treatment42 Treatment43 Treatment44 Treatment45 4.900e+00 5.222e+00 3.000e+00 8.500e+00 -3.065e-14 -5.467e-14 Treatment46 Treatment48 Treatment49 Treatment50 Treatment51 Treatment52 4.500e+00 5.800e+00 -4.893e-14 1.133e+01 -4.000e+00 8.417e+00 Treatment54 Treatment55 Treatment56 Treatment57 Treatment58 Treatment59 6.750e+00 3.889e+00 9.000e+00 2.000e+00 1.000e+01 5.857e+00 Treatment60 Treatment62 Treatment66 2.750e+00 1.233e+01 2.225e+01 > (aov.xdf<-aov(lmxdf) ) Call: aov(formula = lmxdf) Terms: Treatment Residuals Sum of Squares 2822.734 14269.502 Deg. of Freedom 26 126 Residual standard error: 10.64190 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 2822.7 108.6 0.9586 0.5281 Residuals 126 14269.5 113.3 > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/www/html/rcomp/tmp/134a71260642076.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/www/html/rcomp/tmp/2pnkl1260642076.tab") > postscript(file="/var/www/html/rcomp/tmp/3bxgr1260642076.ps",horizontal=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/www/html/rcomp/tmp/4wxxc1260642076.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(thsd) + dev.off() + 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/www/html/rcomp/tmp/5r3dd1260642076.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/www/html/rcomp/tmp/6a8ov1260642076.tab") + } > library(car) > lt.lmxdf<-levene.test(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/www/html/rcomp/tmp/7r12j1260642076.tab") > try(system("convert tmp/3bxgr1260642076.ps tmp/3bxgr1260642076.png",intern=TRUE)) character(0) > try(system("convert tmp/4wxxc1260642076.ps tmp/4wxxc1260642076.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.752 0.347 2.917