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(62239.3,64816.6,62625.3,67923,64363.7,67342,64411.2,69174.5,66290.2,69336.8,66712.2,72225.9,68229.5,71096.3,68407.9,74522.4,71798.4,75074.3,72694.6,78789.4,74814.5,78303.2,75431.6,82600.7,78830.5,82168.1,79493.2,86876.6,83478.5,87003.2,83672.7,90914.2,86448,90577.7,86621.1,91418.5,84275.4,87677.9,85149.6,92600,87111.3,92293.9,89060,97281.6,91812,95980.4,92043.7,100079.2,94384.8,97900.5,93630.8,102255.2,95251.8,100001.8,95689.8,104298,97435.1,101220.2,97537,105834.9) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 62239.3 68229.5 78830.5 84275.4 94384.8 NA [2,] 64816.6 71096.3 82168.1 87677.9 97900.5 NA [3,] 62625.3 68407.9 79493.2 85149.6 93630.8 NA [4,] 67923.0 74522.4 86876.6 92600.0 102255.2 NA [5,] 64363.7 71798.4 83478.5 87111.3 95251.8 NA [6,] 67342.0 75074.3 87003.2 92293.9 100001.8 NA [7,] 64411.2 72694.6 83672.7 89060.0 95689.8 NA [8,] 69174.5 78789.4 90914.2 97281.6 104298.0 NA [9,] 66290.2 74814.5 86448.0 91812.0 97435.1 NA [10,] 69336.8 78303.2 90577.7 95980.4 101220.2 NA [11,] 66712.2 75431.6 86621.1 92043.7 97537.0 NA [12,] 72225.9 82600.7 91418.5 100079.2 105834.9 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 2577.3 2866.8 3337.6 3402.5 3515.7 NA [2,] -2191.3 -2688.4 -2674.9 -2528.3 -4269.7 NA [3,] 5297.7 6114.5 7383.4 7450.4 8624.4 NA [4,] -3559.3 -2724.0 -3398.1 -5488.7 -7003.4 NA [5,] 2978.3 3275.9 3524.7 5182.6 4750.0 NA [6,] -2930.8 -2379.7 -3330.5 -3233.9 -4312.0 NA [7,] 4763.3 6094.8 7241.5 8221.6 8608.2 NA [8,] -2884.3 -3974.9 -4466.2 -5469.6 -6862.9 NA [9,] 3046.6 3488.7 4129.7 4168.4 3785.1 NA [10,] -2624.6 -2871.6 -3956.6 -3936.7 -3683.2 NA [11,] 5513.7 7169.1 4797.4 8035.5 8297.9 NA [12,] -3996.4 -3770.2 -7143.1 -5694.4 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/1w5dm1445588292.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/292di1445588292.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/38jun1445588292.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/4d3y71445588292.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,] 62239.3 64816.6 62625.3 67923.0 64363.7 67342.0 64411.2 69174.5 66290.2 [2,] 68229.5 71096.3 68407.9 74522.4 71798.4 75074.3 72694.6 78789.4 74814.5 [3,] 78830.5 82168.1 79493.2 86876.6 83478.5 87003.2 83672.7 90914.2 86448.0 [4,] 84275.4 87677.9 85149.6 92600.0 87111.3 92293.9 89060.0 97281.6 91812.0 [5,] 94384.8 97900.5 93630.8 102255.2 95251.8 100001.8 95689.8 104298.0 97435.1 [,10] [,11] [,12] [1,] 69336.8 66712.2 72225.9 [2,] 78303.2 75431.6 82600.7 [3,] 90577.7 86621.1 91418.5 [4,] 95980.4 92043.7 100079.2 [5,] 101220.2 97537.0 105834.9 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 67492.51 70451.58 67663.56 74103.01 72658.44 74835.87 72108.95 77847.66 [2,] 90168.49 93884.62 91322.84 99650.19 94298.56 99170.53 95236.45 103980.74 [,9] [,10] [,11] [,12] [1,] 74437.61 78087.04 74883.03 79068.24 [2,] 98458.39 103068.36 98359.17 103768.76 $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(62239.3, 68229.5, 78830.5, 84275.4, 94384.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5uend1445588292.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] [1,] 2577.3 -2688.4 5297.7 -7003.4 2978.3 -3330.5 4763.3 -6862.9 3046.6 -3956.6 [2,] 2866.8 -2688.4 6114.5 -5488.7 3275.9 -3330.5 6094.8 -5469.6 3488.7 -3936.7 [3,] 3337.6 -2674.9 7383.4 -3559.3 3524.7 -3233.9 7241.5 -4466.2 3785.1 -3683.2 [4,] 3402.5 -2528.3 7450.4 -3398.1 4750.0 -2930.8 8221.6 -3974.9 4129.7 -2871.6 [5,] 3515.7 -2528.3 8624.4 -2724.0 5182.6 -2379.7 8608.2 -2884.3 4168.4 -2624.6 [,11] [,12] [1,] 4797.4 -7143.10 [2,] 5513.7 -6418.75 [3,] 7169.1 -4845.40 [4,] 8035.5 -3883.30 [5,] 8297.9 -3770.20 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2959.076 -2788.026 6439.456 -5036.513 2483.105 -3516.327 5738.708 [2,] 3716.124 -2561.774 8327.344 -2082.087 4566.295 -2951.473 8744.292 [,8] [,9] [,10] [,11] [,12] [1,] -5522.351 3332.171 -4435.797 5387.202 -6848.405 [2,] -3410.049 4238.029 -2930.603 8950.998 -2842.394 $out [1] -2191.3 -4269.7 -4312.0 $group [1] 2 2 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(2577.3, 2866.8, 3337.60000000001, 3402.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ldo51445588292.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] [1,] 62239.30 68229.50 78830.50 84275.40 93630.80 NA [2,] 64387.45 71447.35 82823.30 87394.60 95470.80 NA [3,] 66501.20 74668.45 86534.55 91927.85 97718.75 NA [4,] 68548.75 76867.40 88790.45 94290.20 101737.70 NA [5,] 72225.90 82600.70 91418.50 100079.20 105834.90 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 64603.2 72196.33 83812.89 88782.72 94860.37 NA [2,] 68399.2 77140.57 89256.21 95072.98 100577.13 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(62239.3, 64387.45, 66501.2, 68548.75, 72225.9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/71ifc1445588292.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,] 77591.90 78830.50 76252.45 [2,] 80566.31 82823.30 79420.98 [3,] 83514.54 86534.55 83437.23 [4,] 85959.55 88790.45 85439.72 [5,] 90431.84 91418.50 91339.95 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 81054.65 83812.89 80692.03 [2,] 85974.43 89256.21 86182.42 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(77591.9, 80566.31, 83514.54, 85959.55, 90431.84, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1w5dm1445588292.ps tmp/1w5dm1445588292.png",intern=TRUE)) character(0) > try(system("convert tmp/292di1445588292.ps tmp/292di1445588292.png",intern=TRUE)) character(0) > try(system("convert tmp/38jun1445588292.ps tmp/38jun1445588292.png",intern=TRUE)) character(0) > try(system("convert tmp/4d3y71445588292.ps tmp/4d3y71445588292.png",intern=TRUE)) character(0) > try(system("convert tmp/5uend1445588292.ps tmp/5uend1445588292.png",intern=TRUE)) character(0) > try(system("convert tmp/6ldo51445588292.ps tmp/6ldo51445588292.png",intern=TRUE)) character(0) > try(system("convert tmp/71ifc1445588292.ps tmp/71ifc1445588292.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.485 0.428 2.947