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 = '4' > par1 <- '4' > #'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] 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 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 62239.3 64363.7 66290.2 68229.5 71798.4 74814.5 78830.5 83478.5 86448.0 [2,] 64816.6 67342.0 69336.8 71096.3 75074.3 78303.2 82168.1 87003.2 90577.7 [3,] 62625.3 64411.2 66712.2 68407.9 72694.6 75431.6 79493.2 83672.7 86621.1 [4,] 67923.0 69174.5 72225.9 74522.4 78789.4 82600.7 86876.6 90914.2 91418.5 [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] 84275.4 87111.3 91812.0 94384.8 95251.8 97435.1 NA [2,] 87677.9 92293.9 95980.4 97900.5 100001.8 101220.2 NA [3,] 85149.6 89060.0 92043.7 93630.8 95689.8 97537.0 NA [4,] 92600.0 97281.6 100079.2 102255.2 104298.0 105834.9 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 2577.3 2978.3 3046.6 2866.8 3275.9 3488.7 3337.6 3524.7 4129.7 [2,] -2191.3 -2930.8 -2624.6 -2688.4 -2379.7 -2871.6 -2674.9 -3330.5 -3956.6 [3,] 5297.7 4763.3 5513.7 6114.5 6094.8 7169.1 7383.4 7241.5 4797.4 [4,] -3559.3 -2884.3 -3996.4 -2724.0 -3974.9 -3770.2 -3398.1 -4466.2 -7143.1 [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] 3402.5 5182.6 4168.4 3515.7 4750.0 3785.1 NA [2,] -2528.3 -3233.9 -3936.7 -4269.7 -4312.0 -3683.2 NA [3,] 7450.4 8221.6 8035.5 8624.4 8608.2 8297.9 NA [4,] -5488.7 -5469.6 -5694.4 -7003.4 -6862.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/1vnmf1444981730.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/26u1n1444981730.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/32yum1444981730.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/4kkjc1444981730.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] [1,] 62239.30 64816.60 62625.30 67923.0 [2,] 70013.95 73085.30 70551.25 76655.9 [3,] 83478.50 87003.20 83672.70 90914.2 [4,] 89461.65 94137.15 90551.85 98680.4 [5,] 97435.10 101220.20 97537.00 105834.9 $n [1] 15 15 15 15 $conf [,1] [,2] [,3] [,4] [1,] 75544.73 78415.01 75513.37 81929.21 [2,] 91412.27 95591.39 91832.03 99899.19 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" Warning message: In bxp(list(stats = c(62239.3, 70013.95, 83478.5, 89461.65, 97435.1, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5zl7g1444981730.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] [1,] 2577.30 -4312.00 4763.30 -7143.1 [2,] 3161.25 -3809.95 5804.25 -5694.4 [3,] 3488.70 -2930.80 7241.50 -4231.3 [4,] 3957.40 -2649.75 8128.55 -3559.3 [5,] 4750.00 -2191.30 8624.40 -2724.0 $n [1] 15 15 15 14 $conf [,1] [,2] [,3] [,4] [1,] 3163.907 -3404.109 6293.292 -5132.895 [2,] 3813.493 -2457.491 8189.708 -3329.705 $out [1] 5182.6 $group [1] 1 $names [1] "1" "2" "3" "4" Warning message: In bxp(list(stats = c(2577.3, 3161.25000000001, 3488.7, 3957.39999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6q91i1444981730.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] [1,] 62239.30 64363.70 66290.20 68229.50 71798.40 74814.50 78830.50 83478.50 [2,] 62432.30 64387.45 66501.20 68318.70 72246.50 75123.05 79161.85 83575.60 [3,] 63720.95 65876.60 68024.50 69752.10 73884.45 76867.40 80830.65 85337.95 [4,] 66369.80 68258.25 70781.35 72809.35 76931.85 80451.95 84522.35 88958.70 [5,] 67923.00 69174.50 72225.90 74522.40 78789.40 82600.70 86876.60 90914.20 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] 86448.00 84275.40 87111.30 91812.00 93630.80 95251.8 97435.10 NA [2,] 86534.55 84712.50 88085.65 91927.85 94007.80 95470.8 97486.05 NA [3,] 88599.40 86413.75 90676.95 94012.05 96142.65 97845.8 99378.60 NA [4,] 90998.10 90138.95 94787.75 98029.80 100077.85 102149.9 103527.55 NA [5,] 91418.50 92600.00 97281.60 100079.20 102255.20 104298.0 105834.90 NA $n [1] 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 60610.32 62818.67 64643.18 66204.49 70183.02 72657.57 76595.85 81085.3 [2,] 66831.57 68934.53 71405.82 73299.71 77585.88 81077.23 85065.44 89590.6 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] 85073.2 82126.85 85382.29 89191.51 91347.31 92569.31 94605.82 NA [2,] 92125.6 90700.65 95971.61 98832.59 100937.99 103122.29 104151.38 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(62239.3, 62432.3, 63720.95, 66369.8, 67923, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/75yt91444981730.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,] 80450.87 83478.50 79737.80 [2,] 80664.79 83575.60 80144.67 [3,] 82465.79 85337.95 82081.39 [4,] 85919.57 88958.70 85639.69 [5,] 87786.27 90914.20 87668.15 $n [1] 4 4 4 $conf [,1] [,2] [,3] [1,] 78314.51 81085.3 77740.33 [2,] 86617.06 89590.6 86422.45 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(80450.8666666667, 80664.79, 82465.7866666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1vnmf1444981730.ps tmp/1vnmf1444981730.png",intern=TRUE)) character(0) > try(system("convert tmp/26u1n1444981730.ps tmp/26u1n1444981730.png",intern=TRUE)) character(0) > try(system("convert tmp/32yum1444981730.ps tmp/32yum1444981730.png",intern=TRUE)) character(0) > try(system("convert tmp/4kkjc1444981730.ps tmp/4kkjc1444981730.png",intern=TRUE)) character(0) > try(system("convert tmp/5zl7g1444981730.ps tmp/5zl7g1444981730.png",intern=TRUE)) character(0) > try(system("convert tmp/6q91i1444981730.ps tmp/6q91i1444981730.png",intern=TRUE)) character(0) > try(system("convert tmp/75yt91444981730.ps tmp/75yt91444981730.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.445 0.442 2.890