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 + ,67 + ,36 + ,86 + ,56 + ,86 + ,48 + ,103 + ,32 + ,74 + ,44 + ,63 + ,39 + ,82 + ,34 + ,93 + ,41 + ,77 + ,50 + ,111 + ,39 + ,71 + ,62 + ,103 + ,52 + ,89 + ,37 + ,75 + ,50 + ,88 + ,41 + ,84 + ,55 + ,85 + ,41 + ,70 + ,56 + ,104 + ,39 + ,88 + ,52 + ,77 + ,46 + ,77 + ,44 + ,72 + ,48 + ,70 + ,41 + ,83 + ,50 + ,110 + ,50 + ,91 + ,44 + ,80 + ,52 + ,91 + ,54 + ,86 + ,44 + ,85 + ,52 + ,107 + ,37 + ,93 + ,52 + ,87 + ,50 + ,84 + ,36 + ,73 + ,50 + ,84 + ,52 + ,86 + ,55 + ,99 + ,31 + ,75 + ,36 + ,87 + ,49 + ,79 + ,42 + ,82 + ,37 + ,95 + ,41 + ,84 + ,30 + ,85 + ,52 + ,95 + ,30 + ,63 + ,41 + ,78 + ,44 + ,85 + ,66 + ,86 + ,48 + ,75 + ,43 + ,98 + ,57 + ,71 + ,46 + ,63 + ,54 + ,71 + ,48 + ,84 + ,48 + ,81 + ,52 + ,93 + ,62 + ,79 + ,58 + ,63 + ,58 + ,93 + ,62 + ,92 + ,48 + ,93 + ,46 + ,83 + ,34 + ,80 + ,66 + ,111 + ,52 + ,92 + ,55 + ,79 + ,55 + ,69 + ,57 + ,83 + ,56 + ,80 + ,55 + ,91 + ,56 + ,97 + ,54 + ,85 + ,55 + ,85 + ,46 + ,99 + ,52 + ,67 + ,32 + ,87 + ,44 + ,68 + ,46 + ,81 + ,59 + ,80 + ,46 + ,93 + ,46 + ,93 + ,54 + ,102 + ,66 + ,104 + ,56 + ,90 + ,59 + ,85 + ,57 + ,92 + ,52 + ,82 + ,48 + ,85 + ,44 + ,89 + ,41 + ,77 + ,50 + ,79 + ,48 + ,76 + ,48 + ,101 + ,59 + ,81 + ,34 + ,92 + ,46 + ,89 + ,54 + ,81 + ,55 + ,77 + ,54 + ,95 + ,59 + ,85 + ,44 + ,81 + ,54 + ,76 + ,52 + ,93 + ,66 + ,104 + ,44 + ,89 + ,57 + ,76 + ,39 + ,77 + ,60 + ,71 + ,45 + ,79 + ,41 + ,89 + ,50 + ,81 + ,39 + ,99 + ,43 + ,81 + ,48 + ,84 + ,37 + ,85 + ,58 + ,111 + ,46 + ,78 + ,43 + ,111 + ,44 + ,78 + ,34 + ,87 + ,30 + ,92 + ,50 + ,93 + ,39 + ,70 + ,37 + ,84 + ,55 + ,75 + ,48 + ,105 + ,41 + ,96 + ,39 + ,85 + ,36 + ,87 + ,43 + ,75 + ,50 + ,103 + ,55 + ,86 + ,43 + ,77 + ,60 + ,74 + ,48 + ,74 + ,30 + ,76 + ,43 + ,83 + ,39 + ,101 + ,52 + ,83 + ,39 + ,92 + ,39 + ,74 + ,56 + ,87 + ,59 + ,71 + ,46 + ,79 + ,57 + ,83 + ,50 + ,80 + ,54 + ,90 + ,50 + ,80 + ,60 + ,96 + ,59 + ,109 + ,41 + ,98 + ,48 + ,85 + ,59 + ,83 + ,60 + ,86 + ,56 + ,72 + ,56 + ,83 + ,51 + ,75) + ,dim=c(2 + ,160) + ,dimnames=list(c('RespVar' + ,'Mothersviq') + ,1:160)) > y <- array(NA,dim=c(2,160),dimnames=list(c('RespVar','Mothersviq'),1:160)) > 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] "RespVar" > (V2<-dimnames(y)[[1]][cat2]) [1] "Mothersviq" > 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) Treatment102 Treatment103 Treatment104 Treatment105 43.5000 10.5000 9.8333 19.1667 4.5000 Treatment107 Treatment109 Treatment110 Treatment111 Treatment63 8.5000 15.5000 6.5000 10.7500 1.0000 Treatment67 Treatment68 Treatment69 Treatment70 Treatment71 0.5000 0.5000 11.5000 -0.8333 10.3000 Treatment72 Treatment73 Treatment74 Treatment75 Treatment76 6.5000 -7.5000 1.2500 0.6667 3.7500 Treatment77 Treatment78 Treatment79 Treatment80 Treatment81 1.7857 0.1667 7.6667 5.3333 5.6429 Treatment82 Treatment83 Treatment84 Treatment85 Treatment86 0.8333 7.8750 1.5000 4.1667 10.6429 Treatment87 Treatment88 Treatment89 Treatment90 Treatment91 -2.5000 1.0000 1.9000 11.5000 8.8333 Treatment92 Treatment93 Treatment95 Treatment96 Treatment97 2.1667 3.5000 4.1667 7.0000 12.5000 Treatment98 Treatment99 -1.5000 3.1667 > (aov.xdf<-aov(lmxdf) ) Call: aov(formula = lmxdf) Terms: Treatment Residuals Sum of Squares 3130.374 8287.601 Deg. of Freedom 41 118 Residual standard error: 8.380567 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 41 3130.4 76.4 1.0871 0.3564 Residuals 118 8287.6 70.2 > > #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/1gb9g1259861323.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/2w2im1259861323.tab") > postscript(file="/var/www/html/rcomp/tmp/3x7w21259861323.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/4vc3j1259861323.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/5pout1259861323.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/6zvg21259861323.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/7vn6q1259861323.tab") > > system("convert tmp/3x7w21259861323.ps tmp/3x7w21259861323.png") > system("convert tmp/4vc3j1259861323.ps tmp/4vc3j1259861323.png") > > > proc.time() user system elapsed 12.720 0.485 12.963