R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 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(551.91,551.46,550.12,549.95,548.01,548.92,548.92,549.06,547.07,546.5,544.95,544.23,544.23,541.6,541.37,540.43,540.47,540.52,540.52,539.7,540.89,540.51,537.43,538.14,538.14,537.74,540.33,540.02,539.21,539.84,539.84,537.3,536.27,536.75,536.21,536.99,536.99,536.57,536.91,536.97,540.45,542.42,542.42,542.98,540.19,537.16,537.35,537.03,537.03,536.27,534.71,537.12,537.07,537.33,537.33,538.79,539.24,537.17,536.46,532.3,532.3,532.89,533.47,532.54,533.8,534.15,534.15,534.15,534.28,535.63,534.21,533.78,533.78,534.55,536.93,536.09,533.91,533.99,533.99,533.76,532.5,529.5,528.62,528.7,521.27,521.19,519.43,516.81,516.78,515.45,516.22,517.01,518.19,516.79,516.87,514.1) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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] 8 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 551.91 544.23 538.14 536.99 537.03 532.30 533.78 521.27 NA [2,] 551.46 541.60 537.74 536.57 536.27 532.89 534.55 521.19 NA [3,] 550.12 541.37 540.33 536.91 534.71 533.47 536.93 519.43 NA [4,] 549.95 540.43 540.02 536.97 537.12 532.54 536.09 516.81 NA [5,] 548.01 540.47 539.21 540.45 537.07 533.80 533.91 516.78 NA [6,] 548.92 540.52 539.84 542.42 537.33 534.15 533.99 515.45 NA [7,] 548.92 540.52 539.84 542.42 537.33 534.15 533.99 516.22 NA [8,] 549.06 539.70 537.30 542.98 538.79 534.15 533.76 517.01 NA [9,] 547.07 540.89 536.27 540.19 539.24 534.28 532.50 518.19 NA [10,] 546.50 540.51 536.75 537.16 537.17 535.63 529.50 516.79 NA [11,] 544.95 537.43 536.21 537.35 536.46 534.21 528.62 516.87 NA [12,] 544.23 538.14 536.99 537.03 532.30 533.78 528.70 514.10 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -0.45 -2.63 -0.40 -0.42 -0.76 0.59 0.77 -0.08 NA [2,] -1.34 -0.23 2.59 0.34 -1.56 0.58 2.38 -1.76 NA [3,] -0.17 -0.94 -0.31 0.06 2.41 -0.93 -0.84 -2.62 NA [4,] -1.94 0.04 -0.81 3.48 -0.05 1.26 -2.18 -0.03 NA [5,] 0.91 0.05 0.63 1.97 0.26 0.35 0.08 -1.33 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.77 NA [7,] 0.14 -0.82 -2.54 0.56 1.46 0.00 -0.23 0.79 NA [8,] -1.99 1.19 -1.03 -2.79 0.45 0.13 -1.26 1.18 NA [9,] -0.57 -0.38 0.48 -3.03 -2.07 1.35 -3.00 -1.40 NA [10,] -1.55 -3.08 -0.54 0.19 -0.71 -1.42 -0.88 0.08 NA [11,] -0.72 0.71 0.78 -0.32 -4.16 -0.43 0.08 -2.77 NA [12,] 0.00 0.00 0.00 0.00 0.00 0.00 -7.43 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/117pf1424886779.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/2vn171424886779.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/3n8la1424886779.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/404vr1424886779.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] [1,] 521.270 532.89 533.47 532.540 533.800 533.990 533.990 533.760 532.500 [2,] 533.040 533.72 534.09 534.315 533.855 534.070 534.070 533.955 533.390 [3,] 537.010 536.42 536.92 537.045 538.140 538.585 538.585 538.045 537.755 [4,] 541.185 539.67 540.85 540.225 540.460 541.470 541.470 541.340 540.540 [5,] 551.910 541.60 550.12 540.430 548.010 548.920 548.920 549.060 547.070 [,10] [,11] [,12] [1,] 529.500 528.620 528.700 [2,] 532.565 531.415 530.500 [3,] 536.955 536.335 535.385 [4,] 538.840 537.390 537.585 [5,] 546.500 544.950 544.230 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 532.4601 533.0962 533.1438 533.7436 534.4504 534.4513 534.4513 533.9196 [2,] 541.5599 539.7438 540.6962 540.3464 541.8296 542.7187 542.7187 542.1704 [,9] [,10] [,11] [,12] [1,] 533.7609 533.4497 532.9973 531.4272 [2,] 541.7491 540.4603 539.6727 539.3428 $out [1] 551.46 521.19 519.43 549.95 516.81 516.78 515.45 516.22 517.01 518.19 [11] 516.79 516.87 514.10 $group [1] 2 2 3 4 4 5 6 7 8 9 10 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(521.27, 533.04, 537.01, 541.185, 551.91, 532.89, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5o7go1424886779.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] [1,] -0.760 -1.760 -0.940 -2.180 0.050 0 -0.820 -2.790 -3.030 -3.080 -4.160 [2,] -0.605 -1.450 -0.935 -1.375 0.065 0 -0.525 -1.625 -2.535 -1.485 -1.745 [3,] -0.410 0.055 -0.575 -0.040 0.305 0 0.070 -0.450 -0.985 -0.795 -0.375 [4,] 0.255 1.480 -0.055 0.650 0.770 0 0.675 0.815 0.050 -0.230 0.395 [5,] 0.770 2.590 0.060 3.480 0.910 0 1.460 1.190 1.350 0.190 0.780 [,12] [1,] 0 [2,] 0 [3,] 0 [4,] 0 [5,] 0 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.89040835 -1.58174 -1.06658063 -1.171194 -0.08882312 0 -0.6003372 [2,] 0.07040835 1.69174 -0.08341937 1.091194 0.69882312 0 0.7403372 [,8] [,9] [,10] [,11] [,12] [1,] -1.813019 -2.4290181 -1.49606102 -1.5704347 0 [2,] 0.913019 0.4590181 -0.09393898 0.8204347 0 $out [1] -2.63 2.41 -2.62 1.97 -1.33 0.77 -2.54 -7.43 $group [1] 1 3 3 5 5 6 7 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.759999999999991, -0.604999999999961, -0.409999999999968, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6t80d1424886779.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] [1,] 544.230 539.700 536.21 536.570 536.270 532.300 528.620 514.10 NA [2,] 546.785 540.065 536.87 536.980 536.365 533.180 531.000 516.50 NA [3,] 548.920 540.515 537.94 537.255 537.095 533.975 533.845 516.84 NA [4,] 550.035 541.130 539.84 541.435 537.330 534.180 534.270 518.81 NA [5,] 551.910 541.600 540.33 542.980 537.330 535.630 536.930 521.27 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 547.4377 540.0292 536.5854 535.223 536.6549 533.5189 532.3535 515.7864 [2,] 550.4023 541.0008 539.2946 539.287 537.5351 534.4311 535.3365 517.8936 [,9] [1,] NA [2,] NA $out [1] 544.23 537.43 538.14 534.71 538.79 539.24 532.30 $group [1] 2 2 2 5 5 5 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(544.23, 546.785, 548.92, 550.035, 551.91, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7hb0i1424886779.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,] 534.0125 535.3850 534.3537 [2,] 535.5400 536.6700 536.2356 [3,] 536.3875 537.0275 537.1344 [4,] 536.6263 538.0925 537.5238 [5,] 536.9562 538.5850 537.6625 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 535.8921 536.3787 536.5469 [2,] 536.8829 537.6763 537.7219 $out [1] 533.1588 $group [1] 1 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(534.0125, 535.54, 536.3875, 536.62625, 536.95625, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/117pf1424886779.ps tmp/117pf1424886779.png",intern=TRUE)) character(0) > try(system("convert tmp/2vn171424886779.ps tmp/2vn171424886779.png",intern=TRUE)) character(0) > try(system("convert tmp/3n8la1424886779.ps tmp/3n8la1424886779.png",intern=TRUE)) character(0) > try(system("convert tmp/404vr1424886779.ps tmp/404vr1424886779.png",intern=TRUE)) character(0) > try(system("convert tmp/5o7go1424886779.ps tmp/5o7go1424886779.png",intern=TRUE)) character(0) > try(system("convert tmp/6t80d1424886779.ps tmp/6t80d1424886779.png",intern=TRUE)) character(0) > try(system("convert tmp/7hb0i1424886779.ps tmp/7hb0i1424886779.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.556 0.406 2.998