R version 3.0.3 (2014-03-06) -- "Warm Puppy" Copyright (C) 2014 The R Foundation for Statistical Computing Platform: i686-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 <- c(812,100,113,213,149,134,228,138,162,291,182,2081,2752,125,144,274,257,186,327,209,213,375,400,1054,3377,101,120,221,222,167,297,185,189,298,237,1011,3013,110,109,215,176,134,202,139,169,262,214,1238,3748,127,160,138,134,163,172,163,193,226,344,1294,3524,141,186,135,161,131,170,146,160,151,151,1365) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., (2012), Mean Plot (v1.0.4) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_meanplot.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > # > par1 <- as.numeric(par1) > (n <- length(x)) [1] 72 > (np <- floor(n / par1)) [1] 6 > arr <- array(NA,dim=c(par1,np+1)) > darr <- array(NA,dim=c(par1,np+1)) > ari <- array(0,dim=par1) > dx <- diff(x) > j <- 0 > for (i in 1:n) + { + j = j + 1 + ari[j] = ari[j] + 1 + arr[j,ari[j]] <- x[i] + darr[j,ari[j]] <- dx[i] + if (j == par1) j = 0 + } > ari [1] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 812 2752 3377 3013 3748 3524 NA [2,] 100 125 101 110 127 141 NA [3,] 113 144 120 109 160 186 NA [4,] 213 274 221 215 138 135 NA [5,] 149 257 222 176 134 161 NA [6,] 134 186 167 134 163 131 NA [7,] 228 327 297 202 172 170 NA [8,] 138 209 185 139 163 146 NA [9,] 162 213 189 169 193 160 NA [10,] 291 375 298 262 226 151 NA [11,] 182 400 237 214 344 151 NA [12,] 2081 1054 1011 1238 1294 1365 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -712 -2627 -3276 -2903 -3621 -3383 NA [2,] 13 19 19 -1 33 45 NA [3,] 100 130 101 106 -22 -51 NA [4,] -64 -17 1 -39 -4 26 NA [5,] -15 -71 -55 -42 29 -30 NA [6,] 94 141 130 68 9 39 NA [7,] -90 -118 -112 -63 -9 -24 NA [8,] 24 4 4 30 30 14 NA [9,] 129 162 109 93 33 -9 NA [10,] -109 25 -61 -48 118 0 NA [11,] 1899 654 774 1024 950 1214 NA [12,] 671 2323 2002 2510 2230 NA NA > arr.mean <- array(NA,dim=par1) > arr.median <- array(NA,dim=par1) > arr.midrange <- array(NA,dim=par1) > for (j in 1:par1) + { + arr.mean[j] <- mean(arr[j,],na.rm=TRUE) + arr.median[j] <- median(arr[j,],na.rm=TRUE) + arr.midrange[j] <- (quantile(arr[j,],0.75,na.rm=TRUE) + quantile(arr[j,],0.25,na.rm=TRUE)) / 2 + } > overall.mean <- mean(x) > overall.median <- median(x) > overall.midrange <- (quantile(x,0.75) + quantile(x,0.25)) / 2 > postscript(file="/var/wessaorg/rcomp/tmp/1xud61394716907.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(arr.mean,type='b',ylab='mean',main='Mean Plot',xlab='Periodic Index') > mtext(paste('#blocks = ',np)) > abline(overall.mean,0) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/2wd081394716907.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(arr.median,type='b',ylab='median',main='Median Plot',xlab='Periodic Index') > mtext(paste('#blocks = ',np)) > abline(overall.median,0) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/3be1v1394716907.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(arr.midrange,type='b',ylab='midrange',main='Midrange Plot',xlab='Periodic Index') > mtext(paste('#blocks = ',np)) > abline(overall.midrange,0) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/454ll1394716907.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > z <- data.frame(t(arr)) > names(z) <- c(1:par1) > (boxplot(z,notch=TRUE,col='grey',xlab='Periodic Index',ylab='Value',main='Notched Box Plots - Periodic Subseries')) $stats [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] 2752 100.0 109 135 134.0 131.0 170 138.0 160 151.0 151.0 1011 [2,] 2752 101.0 113 138 149.0 134.0 172 139.0 162 226.0 182.0 1054 [3,] 3195 117.5 132 214 168.5 148.5 215 154.5 179 276.5 225.5 1266 [4,] 3524 127.0 160 221 222.0 167.0 297 185.0 193 298.0 344.0 1365 [5,] 3748 141.0 186 274 257.0 186.0 327 209.0 213 375.0 400.0 1365 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2697.035 100.7292 101.6835 160.4623 121.4126 127.2139 134.371 124.8285 [2,] 3692.965 134.2708 162.3165 267.5377 215.5874 169.7861 295.629 184.1715 [,9] [,10] [,11] [,12] [1,] 159.004 230.0577 121.0048 1065.395 [2,] 198.996 322.9423 329.9952 1466.605 $out [1] 812 2081 $group [1] 1 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(2752, 2752, 3195, 3524, 3748, 100, 101, 117.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5phsg1394716907.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > z <- data.frame(t(darr)) > names(z) <- c(1:par1) > (boxplot(z,notch=TRUE,col='grey',xlab='Periodic Index',ylab='Value',main='Notched Box Plots - Differenced Periodic Subseries')) $stats [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] -3621.0 -1 -51.0 -64.0 -71 9 -118.0 4 -9 -109 654 2002 [2,] -3383.0 13 -22.0 -39.0 -55 39 -112.0 4 33 -61 774 2002 [3,] -3089.5 19 100.5 -10.5 -36 81 -76.5 19 101 -24 987 2230 [4,] -2627.0 33 106.0 1.0 -15 130 -24.0 30 129 25 1214 2323 [5,] -2627.0 45 130.0 26.0 29 141 -9.0 30 162 118 1214 2510 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -3577.144 6.099354 17.93587 -36.30129 -61.80129 22.30206 -133.26284 [2,] -2601.856 31.900646 183.06413 15.30129 -10.19871 139.69794 -19.73716 [,8] [,9] [,10] [,11] [,12] [1,] 2.22916 39.0769 -79.47278 703.1858 2003.182 [2,] 35.77084 162.9231 31.47278 1270.8142 2456.818 $out [1] -712 1899 671 $group [1] 1 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-3621, -3383, -3089.5, -2627, -2627, -1, 13, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/68ma01394716907.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > z <- data.frame(arr) > names(z) <- c(1:np) > (boxplot(z,notch=TRUE,col='grey',xlab='Block Index',ylab='Value',main='Notched Box Plots - Sequential Blocks')) $stats [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 100.0 125.0 101.0 109.0 127.0 131.0 NA [2,] 136.0 197.5 176.0 136.5 149.0 143.5 NA [3,] 172.0 265.5 221.5 189.0 167.5 155.5 NA [4,] 259.5 387.5 297.5 238.5 285.0 178.0 NA [5,] 291.0 400.0 298.0 262.0 344.0 186.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 115.6708 178.8397 166.083 142.4771 105.4695 139.7643 NA [2,] 228.3292 352.1603 276.917 235.5229 229.5305 171.2357 NA $out [1] 812 2081 2752 1054 3377 1011 3013 1238 3748 1294 3524 1365 $group [1] 1 1 2 2 3 3 4 4 5 5 6 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(100, 136, 172, 259.5, 291, 125, 197.5, 265.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7b73r1394716907.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > z <- data.frame(cbind(arr.mean,arr.median,arr.midrange)) > names(z) <- list('mean','median','midrange') > (boxplot(z,notch=TRUE,col='grey',ylab='Overall Central Tendency',main='Notched Box Plots')) $stats [,1] [,2] [,3] [1,] 117.3333 117.5 114.8750 [2,] 157.9167 151.5 155.0625 [3,] 191.2500 196.5 184.6875 [4,] 260.9167 251.0 259.6250 [5,] 267.1667 276.5 265.6250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 144.271 151.1174 136.9958 [2,] 238.229 241.8826 232.3792 $out [1] 2871.000 1340.500 3195.000 1266.000 3152.250 1223.625 $group [1] 1 1 2 2 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(117.333333333333, 157.916666666667, 191.25, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1xud61394716907.ps tmp/1xud61394716907.png",intern=TRUE)) character(0) > try(system("convert tmp/2wd081394716907.ps tmp/2wd081394716907.png",intern=TRUE)) character(0) > try(system("convert tmp/3be1v1394716907.ps tmp/3be1v1394716907.png",intern=TRUE)) character(0) > try(system("convert tmp/454ll1394716907.ps tmp/454ll1394716907.png",intern=TRUE)) character(0) > try(system("convert tmp/5phsg1394716907.ps tmp/5phsg1394716907.png",intern=TRUE)) character(0) > try(system("convert tmp/68ma01394716907.ps tmp/68ma01394716907.png",intern=TRUE)) character(0) > try(system("convert tmp/7b73r1394716907.ps tmp/7b73r1394716907.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.992 0.985 6.017