R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch" Copyright (C) 2016 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(94.46,96.91,101.92,104.53,105.85,106.39,106.08,106.42,106.51,106.59,105.71,104.41,103.04,100.99,100.93,99.31,99.79,99.57,99.11,98.96,97.72,99.35,98.15,97.64,97.49,97.94,98.03,98.05,97.54,98.71,99.33,99.16,98.41,98.43,97.02,97.89,97.92,97.37,97.42,96.12,96.72,96.64,95.28,95.3,95.02,95.57,94.78,95.27,96.14,96.16,95.08,94.39,94.15,94.58,94.16,95.02,94.86,94.49,94.81,94.16,94.83,96.02,95.97,95.88,95.97,97.55,97.49,98.4,98.2,97.16,96.96,96.37,96.34,96.86,96.32,95.44,92.85,92.56,91.74,92.44,93.19,92.62,94.04,93.8,96.73,98.99,100.38,101.07,99.92,101.78,100.91,100.49,101.17,100.25,98.94,99.4,100.02,99.91,99.22,98.84,98.42,97.59,97.07,96.59,95.96,94.22,94.48,93.14,93.73,94.24,98.52,99.09,99.84,99.13,100.88,100.83,101.6,101.8,102.77,103.14) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.327 (Mon, 30 Nov 2015 07:01:18 +0000) > #Author: root > #To cite this work: Wessa P., (2015), Mean Plot (v1.0.5) 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) > x <- na.omit(x) > (n <- length(x)) [1] 120 > (np <- floor(n / par1)) [1] 10 > 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] 10 10 10 10 10 10 10 10 10 10 10 10 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 94.46 103.04 97.49 97.92 96.14 94.83 96.34 96.73 100.02 93.73 NA [2,] 96.91 100.99 97.94 97.37 96.16 96.02 96.86 98.99 99.91 94.24 NA [3,] 101.92 100.93 98.03 97.42 95.08 95.97 96.32 100.38 99.22 98.52 NA [4,] 104.53 99.31 98.05 96.12 94.39 95.88 95.44 101.07 98.84 99.09 NA [5,] 105.85 99.79 97.54 96.72 94.15 95.97 92.85 99.92 98.42 99.84 NA [6,] 106.39 99.57 98.71 96.64 94.58 97.55 92.56 101.78 97.59 99.13 NA [7,] 106.08 99.11 99.33 95.28 94.16 97.49 91.74 100.91 97.07 100.88 NA [8,] 106.42 98.96 99.16 95.30 95.02 98.40 92.44 100.49 96.59 100.83 NA [9,] 106.51 97.72 98.41 95.02 94.86 98.20 93.19 101.17 95.96 101.60 NA [10,] 106.59 99.35 98.43 95.57 94.49 97.16 92.62 100.25 94.22 101.80 NA [11,] 105.71 98.15 97.02 94.78 94.81 96.96 94.04 98.94 94.48 102.77 NA [12,] 104.41 97.64 97.89 95.27 94.16 96.37 93.80 99.40 93.14 103.14 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 2.45 -2.05 0.45 -0.55 0.02 1.19 0.52 2.26 -0.11 0.51 NA [2,] 5.01 -0.06 0.09 0.05 -1.08 -0.05 -0.54 1.39 -0.69 4.28 NA [3,] 2.61 -1.62 0.02 -1.30 -0.69 -0.09 -0.88 0.69 -0.38 0.57 NA [4,] 1.32 0.48 -0.51 0.60 -0.24 0.09 -2.59 -1.15 -0.42 0.75 NA [5,] 0.54 -0.22 1.17 -0.08 0.43 1.58 -0.29 1.86 -0.83 -0.71 NA [6,] -0.31 -0.46 0.62 -1.36 -0.42 -0.06 -0.82 -0.87 -0.52 1.75 NA [7,] 0.34 -0.15 -0.17 0.02 0.86 0.91 0.70 -0.42 -0.48 -0.05 NA [8,] 0.09 -1.24 -0.75 -0.28 -0.16 -0.20 0.75 0.68 -0.63 0.77 NA [9,] 0.08 1.63 0.02 0.55 -0.37 -1.04 -0.57 -0.92 -1.74 0.20 NA [10,] -0.88 -1.20 -1.41 -0.79 0.32 -0.20 1.42 -1.31 0.26 0.97 NA [11,] -1.30 -0.51 0.87 0.49 -0.65 -0.59 -0.24 0.46 -1.34 0.37 NA [12,] -1.37 -0.15 0.03 0.87 0.67 -0.03 2.93 0.62 0.59 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/1l7rh1483953440.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/20pg81483953440.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/3sm031483953440.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/4wisl1483953440.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,] 93.730 94.24 95.080 94.390 92.85 92.56 91.74 92.44 93.19 92.620 [2,] 94.830 96.16 96.320 95.880 95.97 96.64 95.28 95.30 95.02 94.490 [3,] 96.535 97.14 98.275 98.445 97.98 98.15 98.30 98.68 97.96 97.795 [4,] 97.920 98.99 100.380 99.310 99.84 99.57 100.88 100.49 101.17 100.250 [5,] 100.020 100.99 101.920 101.070 99.92 101.78 106.08 106.42 106.51 106.590 [,11] [,12] [1,] 94.04 93.140 [2,] 94.78 94.160 [3,] 96.99 97.005 [4,] 98.94 99.400 [5,] 102.77 104.410 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 94.99111 95.72602 96.24646 96.73124 96.04639 96.68606 95.50202 [2,] 98.07889 98.55398 100.30354 100.15876 99.91361 99.61394 101.09798 [,8] [,9] [,10] [,11] [,12] [1,] 96.08687 94.88721 94.91707 94.9115 94.38689 [2,] 101.27313 101.03279 100.67293 99.0685 99.62311 $out [1] 103.04 104.53 105.85 106.39 105.71 $group [1] 1 4 5 6 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(93.73, 94.83, 96.535, 97.92, 100.02, 94.24, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5sswi1483953440.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,] -2.05 -1.08 -1.620 -1.150 -0.830 -1.36 -0.480 -1.24 -1.740 -1.410 -1.340 [2,] -0.11 -0.54 -0.880 -0.510 -0.290 -0.82 -0.170 -0.63 -0.920 -1.200 -0.650 [3,] 0.48 0.00 -0.235 -0.075 0.175 -0.44 -0.015 -0.18 -0.175 -0.495 -0.375 [4,] 1.19 1.39 0.570 0.600 1.170 -0.06 0.700 0.68 0.200 0.320 0.460 [5,] 2.45 4.28 2.610 1.320 1.860 0.62 0.910 0.77 1.630 1.420 0.870 [,12] [1,] -0.15 [2,] -0.03 [3,] 0.59 [4,] 0.67 [5,] 0.87 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.1695318 -0.9643049 -0.9594778 -0.6296003 -0.5544742 -0.8197263 [2,] 1.1295318 0.9643049 0.4894778 0.4796003 0.9044742 -0.0602737 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.4496867 -0.8345282 -0.7345967 -1.2544526 -0.9296003 0.2213333 [2,] 0.4196867 0.4745282 0.3845967 0.2644526 0.1796003 0.9586667 $out [1] 5.01 -2.59 1.75 -1.37 2.93 $group [1] 2 4 6 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-2.05000000000001, -0.109999999999999, 0.479999999999997, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6xc6r1483953440.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,] 101.920 97.640 97.020 94.780 94.150 94.830 91.740 96.730 93.14 98.520 [2,] 103.165 98.555 97.715 95.275 94.275 95.970 92.590 99.195 95.22 98.805 [3,] 105.780 99.330 98.040 95.845 94.695 96.665 93.495 100.315 97.33 100.335 [4,] 106.405 100.360 98.570 97.045 95.050 97.520 95.880 100.990 99.03 101.700 [5,] 106.590 103.040 99.330 97.920 96.160 98.400 96.860 101.780 100.02 103.140 [,11] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 104.3022 98.50673 97.65003 95.03769 94.34152 95.95803 91.99441 99.49629 [2,] 107.2578 100.15327 98.42997 96.65231 95.04848 97.37197 94.99559 101.13371 [,9] [,10] [,11] [1,] 95.59223 99.01457 NA [2,] 99.06777 101.65543 NA $out [1] 94.46 96.91 93.73 94.24 $group [1] 1 1 10 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(101.92, 103.165, 105.78, 106.405, 106.59, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/79vdq1483953440.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,] 97.0700 96.5350 96.48500 [2,] 97.6525 97.0725 97.07875 [3,] 98.1550 97.9700 97.73250 [4,] 98.3165 98.2875 98.05125 [5,] 98.4500 98.6800 98.34250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 97.85215 97.41583 97.28894 [2,] 98.45785 98.52417 98.17606 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(97.07, 97.6525, 98.155, 98.3165, 98.45, 96.535, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1l7rh1483953440.ps tmp/1l7rh1483953440.png",intern=TRUE)) character(0) > try(system("convert tmp/20pg81483953440.ps tmp/20pg81483953440.png",intern=TRUE)) character(0) > try(system("convert tmp/3sm031483953440.ps tmp/3sm031483953440.png",intern=TRUE)) character(0) > try(system("convert tmp/4wisl1483953440.ps tmp/4wisl1483953440.png",intern=TRUE)) character(0) > try(system("convert tmp/5sswi1483953440.ps tmp/5sswi1483953440.png",intern=TRUE)) character(0) > try(system("convert tmp/6xc6r1483953440.ps tmp/6xc6r1483953440.png",intern=TRUE)) character(0) > try(system("convert tmp/79vdq1483953440.ps tmp/79vdq1483953440.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.375 0.182 2.597