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(329.6 + ,327.2 + ,326.3 + ,315.4 + ,308.6 + ,302.6 + ,295.6 + ,291.5 + ,288.1 + ,281.1 + ,282.4 + ,284.9 + ,274.2 + ,265.7 + ,259.7 + ,253.7 + ,249.5 + ,244.6 + ,243 + ,239.2 + ,235.7 + ,231.1 + ,226.7 + ,221.7 + ,219.4 + ,214.2 + ,211.7 + ,207.7 + ,204.7 + ,201.2 + ,199.9 + ,197.8 + ,195.2 + ,194.3 + ,192.8 + ,188.5 + ,183.2 + ,181.4 + ,180.5 + ,180.2 + ,179.2 + ,177.1 + ,174.2 + ,172.1 + ,171.1 + ,169.8 + ,169.5 + ,165.5 + ,167.2 + ,167.6 + ,171.8 + ,175.9 + ,180 + ,184.9 + ,184.6 + ,187.6 + ,191.5 + ,195.5 + ,201.6 + ,203.5 + ,209.1 + ,217.1 + ,227.6 + ,237.2 + ,245.6 + ,253.2 + ,260.5 + ,266.1 + ,273 + ,280.8 + ,284.4 + ,288.5 + ,284.8 + ,288.9 + ,299.6 + ,307.8 + ,311.4 + ,322 + ,317.8 + ,319.1 + ,322.3 + ,323.1 + ,322.8 + ,325 + ,323.2 + ,318.8 + ,328.2 + ,329.2 + ,326.5 + ,330.1 + ,323.8 + ,321.8 + ,319.6 + ,315.5 + ,310.7 + ,306.5 + ,295.1 + ,288 + ,293.9 + ,289.3 + ,287.4 + ,282.6 + ,276.9 + ,272.7 + ,267.9 + ,262.8 + ,256.6 + ,250.7 + ,243.2 + ,235.1 + ,229.6 + ,222.9 + ,217.6 + ,214.1 + ,210.8 + ,208 + ,202.6 + ,199 + ,195.5 + ,192.1 + ,189.4 + ,182.4 + ,179.2 + ,176.5 + ,174 + ,171.7 + ,169.8 + ,168.3 + ,166.4 + ,165.9 + ,166.4 + ,170.6 + ,177.6 + ,183.4 + ,191.9 + ,201.7 + ,210.6 + ,221.6 + ,232.2 + ,240.4 + ,248.4 + ,258.5 + ,265 + ,271.7 + ,273.9 + ,277.8 + ,273.4 + ,270.9 + ,268.3 + ,264.7 + ,264.1 + ,264.5 + ,262.2 + ,258.6 + ,259.4 + ,262.7 + ,264.9 + ,260.5 + ,256.4 + ,254.7 + ,254.8 + ,255.3 + ,256.8 + ,258.7 + ,259.8 + ,261.7 + ,264.7 + ,269.1 + ,279 + ,283.4 + ,285.5 + ,288.2 + ,292.1 + ,295.6 + ,302.4 + ,308.5 + ,314.1 + ,319.8 + ,329.7 + ,339.7) > 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] 180 > (np <- floor(n / par1)) [1] 15 > 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] 15 15 15 15 15 15 15 15 15 15 15 15 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] 329.6 274.2 219.4 183.2 167.2 209.1 284.8 323.2 295.1 243.2 189.4 177.6 [2,] 327.2 265.7 214.2 181.4 167.6 217.1 288.9 318.8 288.0 235.1 182.4 183.4 [3,] 326.3 259.7 211.7 180.5 171.8 227.6 299.6 328.2 293.9 229.6 179.2 191.9 [4,] 315.4 253.7 207.7 180.2 175.9 237.2 307.8 329.2 289.3 222.9 176.5 201.7 [5,] 308.6 249.5 204.7 179.2 180.0 245.6 311.4 326.5 287.4 217.6 174.0 210.6 [6,] 302.6 244.6 201.2 177.1 184.9 253.2 322.0 330.1 282.6 214.1 171.7 221.6 [7,] 295.6 243.0 199.9 174.2 184.6 260.5 317.8 323.8 276.9 210.8 169.8 232.2 [8,] 291.5 239.2 197.8 172.1 187.6 266.1 319.1 321.8 272.7 208.0 168.3 240.4 [9,] 288.1 235.7 195.2 171.1 191.5 273.0 322.3 319.6 267.9 202.6 166.4 248.4 [10,] 281.1 231.1 194.3 169.8 195.5 280.8 323.1 315.5 262.8 199.0 165.9 258.5 [11,] 282.4 226.7 192.8 169.5 201.6 284.4 322.8 310.7 256.6 195.5 166.4 265.0 [12,] 284.9 221.7 188.5 165.5 203.5 288.5 325.0 306.5 250.7 192.1 170.6 271.7 [,13] [,14] [,15] [,16] [1,] 273.9 264.9 279.0 NA [2,] 277.8 260.5 283.4 NA [3,] 273.4 256.4 285.5 NA [4,] 270.9 254.7 288.2 NA [5,] 268.3 254.8 292.1 NA [6,] 264.7 255.3 295.6 NA [7,] 264.1 256.8 302.4 NA [8,] 264.5 258.7 308.5 NA [9,] 262.2 259.8 314.1 NA [10,] 258.6 261.7 319.8 NA [11,] 259.4 264.7 329.7 NA [12,] 262.7 269.1 339.7 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] -2.4 -8.5 -5.2 -1.8 0.4 8.0 4.1 -4.4 -7.1 -8.1 -7.0 5.8 3.9 [2,] -0.9 -6.0 -2.5 -0.9 4.2 10.5 10.7 9.4 5.9 -5.5 -3.2 8.5 -4.4 [3,] -10.9 -6.0 -4.0 -0.3 4.1 9.6 8.2 1.0 -4.6 -6.7 -2.7 9.8 -2.5 [4,] -6.8 -4.2 -3.0 -1.0 4.1 8.4 3.6 -2.7 -1.9 -5.3 -2.5 8.9 -2.6 [5,] -6.0 -4.9 -3.5 -2.1 4.9 7.6 10.6 3.6 -4.8 -3.5 -2.3 11.0 -3.6 [6,] -7.0 -1.6 -1.3 -2.9 -0.3 7.3 -4.2 -6.3 -5.7 -3.3 -1.9 10.6 -0.6 [7,] -4.1 -3.8 -2.1 -2.1 3.0 5.6 1.3 -2.0 -4.2 -2.8 -1.5 8.2 0.4 [8,] -3.4 -3.5 -2.6 -1.0 3.9 6.9 3.2 -2.2 -4.8 -5.4 -1.9 8.0 -2.3 [9,] -7.0 -4.6 -0.9 -1.3 4.0 7.8 0.8 -4.1 -5.1 -3.6 -0.5 10.1 -3.6 [10,] 1.3 -4.4 -1.5 -0.3 6.1 3.6 -0.3 -4.8 -6.2 -3.5 0.5 6.5 0.8 [11,] 2.5 -5.0 -4.3 -4.0 1.9 4.1 2.2 -4.2 -5.9 -3.4 4.2 6.7 3.3 [12,] -10.7 -2.3 -5.3 1.7 5.6 -3.7 -1.8 -11.4 -7.5 -2.7 7.0 2.2 2.2 [,14] [,15] [,16] [1,] -4.4 4.4 NA [2,] -4.1 2.1 NA [3,] -1.7 2.7 NA [4,] 0.1 3.9 NA [5,] 0.5 3.5 NA [6,] 1.5 6.8 NA [7,] 1.9 6.1 NA [8,] 1.1 5.6 NA [9,] 1.9 5.7 NA [10,] 3.0 9.9 NA [11,] 4.4 10.0 NA [12,] 9.9 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/1gki51394716816.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/2hjjc1394716816.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/3gcbc1394716816.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/49q7b1394716816.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] [1,] 167.20 167.6 171.8 175.90 174.00 171.70 169.80 168.3 166.40 165.90 166.40 [2,] 199.25 198.8 201.8 204.70 207.65 207.65 205.35 202.9 198.90 197.25 198.55 [3,] 264.90 260.5 256.4 253.70 249.50 253.20 256.80 258.7 259.80 258.60 259.40 [4,] 281.90 285.7 289.7 288.75 289.75 289.10 286.25 282.1 280.55 280.95 283.40 [5,] 329.60 327.2 328.2 329.20 326.50 330.10 323.80 321.8 322.30 323.10 329.70 [,12] [1,] 165.5 [2,] 197.8 [3,] 262.7 [4,] 286.7 [5,] 339.7 $n [1] 15 15 15 15 15 15 15 15 15 15 15 15 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 231.1826 225.0488 220.5408 219.4114 216.007 219.9721 223.7965 226.39 [2,] 298.6174 295.9512 292.2592 287.9886 282.993 286.4279 289.8035 291.01 [,9] [,10] [,11] [,12] [1,] 226.4905 224.4542 224.7851 226.4329 [2,] 293.1095 292.7458 294.0149 298.9671 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(167.2, 199.25, 264.9, 281.9, 329.6, 167.6, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ogj01394716816.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,] -8.5 -6.00 -10.9 -6.80 -6.00 -7.00 -4.20 -5.40 -7.00 -6.2 -5.90 -11.40 [2,] -6.1 -3.65 -4.3 -2.85 -3.55 -3.75 -2.45 -3.00 -3.85 -2.5 -4.10 -5.30 [3,] -2.4 -0.90 -1.7 -1.90 -2.10 -1.60 -1.50 -1.90 -0.90 0.5 2.20 -2.05 [4,] 4.0 7.20 3.4 3.75 4.25 0.60 2.45 3.55 2.95 3.3 4.15 2.20 [5,] 8.0 10.70 9.8 8.90 11.00 6.80 8.20 8.00 10.10 9.9 10.00 9.90 $n [1] 15 15 15 15 15 15 15 15 15 15 15 14 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -6.520338 -5.326304 -4.841248 -4.592498 -5.282043 -3.374601 -3.4989758 [2,] 1.720338 3.526304 1.441248 0.792498 1.082043 0.174601 0.4989758 [,8] [,9] [,10] [,11] [,12] [1,] -4.5721003 -3.674089 -1.866135 -1.165623 -5.217046 [2,] 0.7721003 1.874089 2.866135 5.565623 1.117046 $out [1] 7.3 10.6 $group [1] 6 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-8.5, -6.10000000000001, -2.40000000000003, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/662pd1394716816.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] [,8] [,9] [,10] [1,] 281.10 221.7 188.50 165.50 167.20 209.10 284.80 306.50 250.70 192.10 [2,] 286.50 233.4 194.75 170.45 173.85 232.40 303.70 317.15 265.35 200.80 [3,] 299.10 243.8 200.55 175.65 184.75 256.85 318.45 322.50 279.75 212.45 [4,] 320.85 256.7 209.70 180.35 193.50 276.90 322.55 327.35 288.65 226.25 [5,] 329.60 274.2 219.40 183.20 203.50 288.50 325.00 330.10 295.10 243.20 [,11] [,12] [,13] [,14] [,15] [,16] [1,] 165.90 177.60 258.60 254.70 279.00 NA [2,] 167.35 196.80 262.45 255.85 286.85 NA [3,] 171.15 226.90 264.60 259.25 299.00 NA [4,] 177.85 253.45 272.15 263.20 316.95 NA [5,] 189.40 271.70 277.80 269.10 339.70 NA $n [1] 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 283.4327 233.1727 193.7312 171.1345 175.7875 236.5533 309.8524 317.8477 [2,] 314.7673 254.4273 207.3688 180.1655 193.7125 277.1467 327.0476 327.1523 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] 269.1227 200.8421 166.3609 201.0616 260.1758 255.8976 285.2712 NA [2,] 290.3773 224.0579 175.9391 252.7384 269.0242 262.6024 312.7288 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] NA Warning message: In bxp(list(stats = c(281.1, 286.5, 299.1, 320.85, 329.6, 221.7, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/72ek01394716816.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,] 247.3533 249.50 239.1000 [2,] 247.4567 255.05 240.7750 [3,] 247.7200 258.65 242.3750 [4,] 247.9733 260.15 246.2625 [5,] 248.5467 264.90 248.7000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 247.4843 256.3239 239.8721 [2,] 247.9557 260.9761 244.8779 $out [1] 246.10 249.38 $group [1] 1 1 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(247.353333333333, 247.456666666667, 247.72, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1gki51394716816.ps tmp/1gki51394716816.png",intern=TRUE)) character(0) > try(system("convert tmp/2hjjc1394716816.ps tmp/2hjjc1394716816.png",intern=TRUE)) character(0) > try(system("convert tmp/3gcbc1394716816.ps tmp/3gcbc1394716816.png",intern=TRUE)) character(0) > try(system("convert tmp/49q7b1394716816.ps tmp/49q7b1394716816.png",intern=TRUE)) character(0) > try(system("convert tmp/5ogj01394716816.ps tmp/5ogj01394716816.png",intern=TRUE)) character(0) > try(system("convert tmp/662pd1394716816.ps tmp/662pd1394716816.png",intern=TRUE)) character(0) > try(system("convert tmp/72ek01394716816.ps tmp/72ek01394716816.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.278 1.095 6.451