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(36 + ,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 + ,90 + ,48 + ,115 + ,41 + ,84 + ,50 + ,79 + ,50 + ,94 + ,44 + ,97 + ,52 + ,86 + ,54 + ,111 + ,44 + ,87 + ,52 + ,98 + ,37 + ,87 + ,52 + ,68 + ,50 + ,88 + ,36 + ,82 + ,50 + ,111 + ,52 + ,75 + ,55 + ,94 + ,31 + ,95 + ,36 + ,80 + ,49 + ,95 + ,42 + ,68 + ,37 + ,94 + ,41 + ,88 + ,30 + ,84 + ,52 + ,101 + ,30 + ,98 + ,41 + ,78 + ,44 + ,109 + ,66 + ,102 + ,48 + ,81 + ,43 + ,97 + ,57 + ,75 + ,46 + ,97 + ,54 + ,101 + ,48 + ,101 + ,48 + ,95 + ,52 + ,95 + ,62 + ,95 + ,58 + ,90 + ,58 + ,107 + ,62 + ,92 + ,48 + ,86 + ,46 + ,70 + ,34 + ,95 + ,66 + ,96 + ,52 + ,91 + ,55 + ,87 + ,55 + ,92 + ,57 + ,97 + ,56 + ,102 + ,55 + ,91 + ,56 + ,68 + ,54 + ,88 + ,55 + ,97 + ,46 + ,90 + ,52 + ,101 + ,32 + ,94 + ,44 + ,101 + ,46 + ,109 + ,59 + ,100 + ,46 + ,103 + ,46 + ,94 + ,54 + ,97 + ,66 + ,85 + ,56 + ,75 + ,59 + ,77 + ,57 + ,87 + ,52 + ,78 + ,48 + ,108 + ,44 + ,97 + ,41 + ,105 + ,50 + ,106 + ,48 + ,107 + ,48 + ,95 + ,59 + ,107 + ,34 + ,115 + ,46 + ,101 + ,54 + ,85 + ,55 + ,90 + ,54 + ,115 + ,59 + ,95 + ,44 + ,97 + ,54 + ,112 + ,52 + ,97 + ,66 + ,77 + ,44 + ,90 + ,57 + ,94 + ,39 + ,103 + ,60 + ,77 + ,45 + ,98 + ,41 + ,90 + ,50 + ,111 + ,39 + ,77 + ,43 + ,88 + ,48 + ,75 + ,37 + ,92 + ,58 + ,78 + ,46 + ,106 + ,43 + ,80 + ,44 + ,87 + ,34 + ,92 + ,30 + ,111 + ,50 + ,86 + ,39 + ,85 + ,37 + ,90 + ,55 + ,101 + ,48 + ,94 + ,41 + ,86 + ,39 + ,86 + ,36 + ,90 + ,43 + ,75 + ,50 + ,86 + ,55 + ,91 + ,43 + ,97 + ,60 + ,91 + ,48 + ,70 + ,30 + ,98 + ,43 + ,96 + ,39 + ,95 + ,52 + ,100 + ,39 + ,95 + ,39 + ,97 + ,56 + ,97 + ,59 + ,92 + ,46 + ,115 + ,57 + ,88 + ,50 + ,87 + ,54 + ,100 + ,50 + ,98 + ,60 + ,102 + ,59 + ,96) + ,dim=c(2 + ,153) + ,dimnames=list(c('MC30VRB' + ,'WISCRY7V') + ,1:153)) > y <- array(NA,dim=c(2,153),dimnames=list(c('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] "MC30VRB" > (V2<-dimnames(y)[[1]][cat2]) [1] "WISCRY7V" > 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 Treatment103 Treatment105 5.500e+01 -4.857e+00 5.667e+00 -1.250e+01 -1.400e+01 Treatment106 Treatment107 Treatment108 Treatment109 Treatment111 -7.000e+00 1.273e-13 -7.000e+00 -1.000e+01 -9.000e+00 Treatment112 Treatment115 Treatment68 Treatment70 Treatment72 -1.000e+00 -9.500e+00 -9.500e+00 -7.000e+00 -3.000e+00 Treatment73 Treatment75 Treatment77 Treatment78 Treatment79 -7.000e+00 -3.800e+00 1.000e+00 -4.667e+00 -3.000e+00 Treatment80 Treatment81 Treatment82 Treatment84 Treatment85 -1.400e+01 -7.000e+00 -1.900e+01 -1.950e+01 -3.750e+00 Treatment86 Treatment87 Treatment88 Treatment90 Treatment91 -1.122e+01 -6.143e+00 -9.000e+00 -9.400e+00 -2.400e+00 Treatment92 Treatment94 Treatment95 Treatment96 Treatment97 -3.500e+00 -9.875e+00 -8.364e+00 -6.200e+00 -6.917e+00 Treatment98 -1.360e+01 > (aov.xdf<-aov(lmxdf) ) Call: aov(formula = lmxdf) Terms: Treatment Residuals Sum of Squares 2806.521 8160.590 Deg. of Freedom 35 117 Residual standard error: 8.351565 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 35 2806.5 80.2 1.1496 0.2859 Residuals 117 8160.6 69.7 > > #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/1qmm31291059763.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/2t53r1291059763.tab") > postscript(file="/var/www/html/rcomp/tmp/3t53r1291059763.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/44ekc1291059763.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/5qxih1291059763.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/6i6i31291059763.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/746gq1291059763.tab") > > try(system("convert tmp/3t53r1291059763.ps tmp/3t53r1291059763.png",intern=TRUE)) character(0) > try(system("convert tmp/44ekc1291059763.ps tmp/44ekc1291059763.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 7.517 0.487 15.203