R version 3.2.2 (2015-08-14) -- "Fire Safety" Copyright (C) 2015 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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(250.71,251.57,260.85,265.47,262.37,272.39,277.49,274.41,274.42,267.1,258.84,253.97,253.88,253.3,249.86,246,248.42,250.29,246.9,255.2,253.33,251.02,254.5,253.18,256.03,262.15,259.94,253.75,247.69,242.42,231.82,235.88,240.68,260.15,265.32,265.02,279.86,298.3,304.14,295.26,281.93,280.46,272.06,270.05,271.84,268.49,270.92,273.22,269.43,271.21,265.4,265.53,276.78,281.49,283.75,281.45,282.1,274.01,275.51,277.62,275.33,271.15,270.89,265.29,266.96,266.87,267.68,272.37,285.05,296.79,309.15,304.19,307.33,290.68,292.26,294.81,293.67,293.57,286.28,278.93,284.22,282.09,282.26,285.79,294.01,292.73,303.01,298.67,292.38,295.7,294.9,299.46,299.75,294.76,297.68,300.24,302.48,310.2,311.49,307.37,304.58,305.87,309.81,313.91,313.2,307.85,306.89,310.83) > 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] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 250.71 253.88 256.03 279.86 269.43 275.33 307.33 294.01 302.48 NA [2,] 251.57 253.30 262.15 298.30 271.21 271.15 290.68 292.73 310.20 NA [3,] 260.85 249.86 259.94 304.14 265.40 270.89 292.26 303.01 311.49 NA [4,] 265.47 246.00 253.75 295.26 265.53 265.29 294.81 298.67 307.37 NA [5,] 262.37 248.42 247.69 281.93 276.78 266.96 293.67 292.38 304.58 NA [6,] 272.39 250.29 242.42 280.46 281.49 266.87 293.57 295.70 305.87 NA [7,] 277.49 246.90 231.82 272.06 283.75 267.68 286.28 294.90 309.81 NA [8,] 274.41 255.20 235.88 270.05 281.45 272.37 278.93 299.46 313.91 NA [9,] 274.42 253.33 240.68 271.84 282.10 285.05 284.22 299.75 313.20 NA [10,] 267.10 251.02 260.15 268.49 274.01 296.79 282.09 294.76 307.85 NA [11,] 258.84 254.50 265.32 270.92 275.51 309.15 282.26 297.68 306.89 NA [12,] 253.97 253.18 265.02 273.22 277.62 304.19 285.79 300.24 310.83 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 0.86 -0.58 6.12 18.44 1.78 -4.18 -16.65 -1.28 7.72 NA [2,] 9.28 -3.44 -2.21 5.84 -5.81 -0.26 1.58 10.28 1.29 NA [3,] 4.62 -3.86 -6.19 -8.88 0.13 -5.60 2.55 -4.34 -4.12 NA [4,] -3.10 2.42 -6.06 -13.33 11.25 1.67 -1.14 -6.29 -2.79 NA [5,] 10.02 1.87 -5.27 -1.47 4.71 -0.09 -0.10 3.32 1.29 NA [6,] 5.10 -3.39 -10.60 -8.40 2.26 0.81 -7.29 -0.80 3.94 NA [7,] -3.08 8.30 4.06 -2.01 -2.30 4.69 -7.35 4.56 4.10 NA [8,] 0.01 -1.87 4.80 1.79 0.65 12.68 5.29 0.29 -0.71 NA [9,] -7.32 -2.31 19.47 -3.35 -8.09 11.74 -2.13 -4.99 -5.35 NA [10,] -8.26 3.48 5.17 2.43 1.50 12.36 0.17 2.92 -0.96 NA [11,] -4.87 -1.32 -0.30 2.30 2.11 -4.96 3.53 2.56 3.94 NA [12,] -0.09 2.85 14.84 -3.79 -2.29 3.14 8.22 2.24 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/1eauh1444909800.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/2yhi61444909800.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/3y9a51444909800.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/4mvss1444909800.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] [1,] 250.71 251.57 249.86 246.00 247.69 242.42 246.90 255.20 253.33 251.02 [2,] 256.03 262.15 260.85 265.29 262.37 266.87 267.68 270.05 271.84 267.10 [3,] 275.33 271.21 270.89 265.53 276.78 280.46 277.49 274.41 282.10 274.01 [4,] 294.01 292.73 303.01 295.26 292.38 293.57 286.28 281.45 285.05 294.76 [5,] 307.33 310.20 311.49 307.37 304.58 305.87 309.81 281.45 299.75 307.85 [,11] [,12] [1,] 254.50 253.18 [2,] 265.32 265.02 [3,] 275.51 277.62 [4,] 297.68 300.24 [5,] 309.15 310.83 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 255.3272 255.1045 248.6857 249.7458 260.9747 266.398 267.694 268.406 [2,] 295.3328 287.3155 293.0943 281.3142 292.5853 294.522 287.286 280.414 [,9] [,10] [,11] [,12] [1,] 275.1427 259.4424 258.4671 259.0708 [2,] 289.0573 288.5776 292.5529 296.1692 $out [1] 231.82 235.88 299.46 313.91 240.68 313.20 $group [1] 7 8 8 8 9 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(250.71, 256.03, 275.33, 294.01, 307.33, 251.57, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5r36a1444909800.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,] -4.18 -5.81 -8.88 -13.33 -1.47 -10.60 -7.35 -1.87 -8.09 -0.96 -4.96 -3.790 [2,] -1.28 -2.21 -5.60 -6.06 -0.10 -7.29 -2.30 0.01 -5.35 0.17 -1.32 -1.190 [3,] 0.86 1.29 -4.12 -2.79 1.29 -0.80 4.06 0.65 -3.35 2.43 2.11 2.545 [4,] 6.12 5.84 0.13 1.67 3.32 2.26 4.56 4.80 -2.13 3.48 2.56 5.680 [5,] 7.72 10.28 4.62 11.25 4.71 5.10 8.30 5.29 -2.13 5.17 3.94 14.840 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -3.037333 -2.949667 -7.1378 -6.861133 -0.5112 -5.829667 0.4470667 [2,] 4.757333 5.529667 -1.1022 1.281133 3.0912 4.229667 7.6729333 [,8] [,9] [,10] [,11] [,12] [1,] -1.872733 -5.045867 0.6867333 0.06653333 -1.292681 [2,] 3.172733 -1.654133 4.1732667 4.15346667 6.382681 $out [1] 18.44 -16.65 10.02 -5.27 12.68 19.47 11.74 -8.26 12.36 $group [1] 1 1 5 5 8 9 9 10 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-4.18000000000001, -1.27999999999997, 0.859999999999985, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/64qjl1444909800.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,] 250.710 246.000 231.82 268.490 265.400 265.29 278.93 292.380 302.48 NA [2,] 256.405 249.140 241.55 271.380 270.320 267.32 283.24 294.385 306.38 NA [3,] 263.920 252.100 254.89 276.540 276.145 271.76 288.48 296.690 308.83 NA [4,] 273.400 253.605 261.15 288.595 281.470 290.92 293.62 299.605 311.16 NA [5,] 277.490 255.200 265.32 304.140 283.750 309.15 307.33 303.010 313.91 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 256.1685 250.0635 245.9503 268.6881 271.0594 260.9959 283.7456 294.3091 [2,] 271.6715 254.1365 263.8297 284.3919 281.2306 282.5241 293.2144 299.0709 [,9] [,10] [1,] 306.6498 NA [2,] 311.0102 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(250.71, 256.405, 263.92, 273.4, 277.49, 246, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/75m1k1444909800.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,] 274.5211 265.530 275.0200 [2,] 276.1511 272.610 277.1775 [3,] 277.4133 275.420 279.3325 [4,] 279.0239 277.555 281.2150 [5,] 280.4511 282.100 282.6300 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 276.1030 273.1646 277.491 [2,] 278.7236 277.6754 281.174 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(274.521111111111, 276.151111111111, 277.413333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1eauh1444909800.ps tmp/1eauh1444909800.png",intern=TRUE)) character(0) > try(system("convert tmp/2yhi61444909800.ps tmp/2yhi61444909800.png",intern=TRUE)) character(0) > try(system("convert tmp/3y9a51444909800.ps tmp/3y9a51444909800.png",intern=TRUE)) character(0) > try(system("convert tmp/4mvss1444909800.ps tmp/4mvss1444909800.png",intern=TRUE)) character(0) > try(system("convert tmp/5r36a1444909800.ps tmp/5r36a1444909800.png",intern=TRUE)) character(0) > try(system("convert tmp/64qjl1444909800.ps tmp/64qjl1444909800.png",intern=TRUE)) character(0) > try(system("convert tmp/75m1k1444909800.ps tmp/75m1k1444909800.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.979 0.529 3.531