R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree" 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(102.96,107.5,103.5,107.36,103.59,99.04,93.19,93.28,104.48,93.22,106.43,95.25,113.86,101.6,93.83,119.15,95.81,92.14,97.92,86.57,92.39,93.58,101.66,102.37,104.47,87.44,88.74,100.52,101.26,94.76,95.97,78.36,81.6,90.96,90.16,95.01,114.54,105.85,104.14,106.94,94.27,84.31,78.89,69.28,67.15,75.21,77.74,77.86,111.44,107.1,117.78,116.71,97.74,88.71,90.67,83.69,90.61,85.59,93.53,103.14,112.93,108.31,99.52,96.13,90.74,85.08,86.62,76.78,74.59,79.62,90.55,91.17,98.19,109.92,109.43,104.43,102.49,98.68,97.15,92.22,84.55,94.1,95.94,98.17,106.92,104.86,108.51,116.13,109.21,110,98.57,89.41,86.52,83.37,89.42,97.08,106.25,101.33,98.06,103.66,88.34,86.5,91,75.06,81.39,77.88,89.28,93.92,103.45,106.15,98.29,113.29,101.54,94.54,90.92,86.86,90.69,99.29,99.51,94.15) > par1 = '10' > par1 <- '10' > #'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] 12 > 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] 12 12 12 12 12 12 12 12 12 12 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 102.96 106.43 92.39 95.97 94.27 117.78 112.93 90.55 84.55 98.57 [2,] 107.50 95.25 93.58 78.36 84.31 116.71 108.31 91.17 94.10 89.41 [3,] 103.50 113.86 101.66 81.60 78.89 97.74 99.52 98.19 95.94 86.52 [4,] 107.36 101.60 102.37 90.96 69.28 88.71 96.13 109.92 98.17 83.37 [5,] 103.59 93.83 104.47 90.16 67.15 90.67 90.74 109.43 106.92 89.42 [6,] 99.04 119.15 87.44 95.01 75.21 83.69 85.08 104.43 104.86 97.08 [7,] 93.19 95.81 88.74 114.54 77.74 90.61 86.62 102.49 108.51 106.25 [8,] 93.28 92.14 100.52 105.85 77.86 85.59 76.78 98.68 116.13 101.33 [9,] 104.48 97.92 101.26 104.14 111.44 93.53 74.59 97.15 109.21 98.06 [10,] 93.22 86.57 94.76 106.94 107.10 103.14 79.62 92.22 110.00 103.66 [,11] [,12] [,13] [1,] 88.34 98.29 NA [2,] 86.50 113.29 NA [3,] 91.00 101.54 NA [4,] 75.06 94.54 NA [5,] 81.39 90.92 NA [6,] 77.88 86.86 NA [7,] 89.28 90.69 NA [8,] 93.92 99.29 NA [9,] 103.45 99.51 NA [10,] 106.15 94.15 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 4.54 -11.18 1.19 -17.61 -9.96 -1.07 -4.62 0.62 9.55 -9.16 -1.84 [2,] -4.00 18.61 8.08 3.24 -5.42 -18.97 -8.79 7.02 1.84 -2.89 4.50 [3,] 3.86 -12.26 0.71 9.36 -9.61 -9.03 -3.39 11.73 2.23 -3.15 -15.94 [4,] -3.77 -7.77 2.10 -0.80 -2.13 1.96 -5.39 -0.49 8.75 6.05 6.33 [5,] -4.55 25.32 -17.03 4.85 8.06 -6.98 -5.66 -5.00 -2.06 7.66 -3.51 [6,] -5.85 -23.34 1.30 19.53 2.53 6.92 1.54 -1.94 3.65 9.17 11.40 [7,] 0.09 -3.67 11.78 -8.69 0.12 -5.02 -9.84 -3.81 7.62 -4.92 4.64 [8,] 11.20 5.78 0.74 -1.71 33.58 7.94 -2.19 -1.53 -6.92 -3.27 9.53 [9,] -11.26 -11.35 -6.50 2.80 -4.34 9.61 5.03 -4.93 0.79 5.60 2.70 [10,] 13.21 5.82 1.21 -12.67 10.68 9.79 10.93 -7.67 -11.43 -15.32 -7.86 [,12] [,13] [1,] 15.00 NA [2,] -11.75 NA [3,] -7.00 NA [4,] -3.62 NA [5,] -4.06 NA [6,] 3.83 NA [7,] 8.60 NA [8,] 0.22 NA [9,] -5.36 NA [10,] 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/1wbw71456926826.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/2way41456926826.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/3lnoi1456926826.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/4d9tx1456926826.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,] 84.550 78.360 78.890 69.280 81.39 75.210 77.74 76.780 93.530 [2,] 91.470 87.955 88.760 86.040 89.79 84.385 89.01 88.865 97.535 [3,] 97.130 93.840 97.965 95.335 90.83 91.225 91.94 96.300 100.385 [4,] 104.695 107.905 101.600 101.985 104.03 101.735 104.37 100.925 104.310 [5,] 117.780 116.710 113.860 109.920 109.43 119.150 114.54 116.130 111.440 [,10] [1,] 79.620 [2,] 92.720 [3,] 98.950 [4,] 106.545 [5,] 110.000 $n [1] 12 12 12 12 12 12 12 12 12 12 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 91.09799 84.74067 92.10859 88.06238 84.33504 83.31155 84.9342 [2,] 103.16201 102.93933 103.82141 102.60762 97.32496 99.13845 98.9458 [,8] [,9] [,10] [1,] 90.79935 97.29488 92.64432 [2,] 101.80065 103.47512 105.25568 $out [1] 67.15 74.59 $group [1] 5 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" Warning message: In bxp(list(stats = c(84.55, 91.47, 97.13, 104.695, 117.78, 78.36, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5pqac1456926826.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,] -17.610 -18.970 -15.940 -7.770 -17.030 -5.850 -9.84 -6.920 -11.350 -15.320 [2,] -9.560 -7.105 -9.320 -3.695 -5.330 -0.320 -4.97 -1.950 -5.930 -9.645 [3,] -1.455 -0.525 -3.270 -0.645 -3.785 3.090 -1.79 0.480 -1.775 1.210 [4,] 2.865 5.760 3.045 4.075 6.255 8.045 6.13 8.735 3.915 10.235 [5,] 15.000 18.610 11.730 8.750 8.060 19.530 11.78 11.200 9.610 13.210 $n [1] 12 12 12 12 12 12 12 12 12 11 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -7.122126 -6.392813 -8.90976 -4.188949 -9.068996 -0.7253327 -6.852785 [2,] 4.212126 5.342813 2.36976 2.898949 1.498996 6.9053327 3.272785 [,8] [,9] [,10] [1,] -4.3935 -6.265371 -8.260592 [2,] 5.3535 2.715371 10.680592 $out [1] 25.32 -23.34 33.58 $group [1] 5 6 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" Warning message: In bxp(list(stats = c(-17.61, -9.56, -1.45500000000001, 2.865, 15, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6v30t1456926826.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,] 93.19 86.570 87.44 78.36 67.150 83.69 74.59 90.550 84.55 83.37 [2,] 93.28 93.830 92.39 90.16 75.210 88.71 79.62 92.220 95.94 89.41 [3,] 103.23 96.865 97.64 95.49 78.375 92.10 88.68 98.435 105.89 97.57 [4,] 104.48 106.430 101.66 105.85 94.270 103.14 99.52 104.430 109.21 101.33 [5,] 107.50 119.150 104.47 114.54 111.440 117.78 112.93 109.920 116.13 106.25 [,11] [,12] [,13] [1,] 75.06 86.860 NA [2,] 81.39 90.920 NA [3,] 88.81 96.415 NA [4,] 93.92 99.510 NA [5,] 106.15 101.540 NA $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 97.63403 90.56954 93.00834 87.65065 68.85186 84.8902 78.73717 92.3344 [2,] 108.82597 103.16046 102.27166 103.32935 87.89814 99.3098 98.62283 104.5356 [,9] [,10] [,11] [,12] [,13] [1,] 99.25978 91.61429 82.54951 92.12309 NA [2,] 112.52022 103.52571 95.07049 100.70691 NA $out [1] 113.29 $group [1] 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" NA Warning message: In bxp(list(stats = c(93.19, 93.28, 103.23, 104.48, 107.5, 86.57, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7c4ja1456926826.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,] 92.97750 90.8300 92.5600 [2,] 93.22417 91.9400 95.6125 [3,] 95.60125 95.8175 96.5900 [4,] 98.12750 97.9650 98.1925 [5,] 99.56167 100.3850 100.9762 $n [1] 10 10 10 $conf [,1] [,2] [,3] [1,] 93.15135 92.80717 95.30093 [2,] 98.05115 98.82783 97.87907 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(92.9775, 93.2241666666667, 95.60125, 98.1275, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1wbw71456926826.ps tmp/1wbw71456926826.png",intern=TRUE)) character(0) > try(system("convert tmp/2way41456926826.ps tmp/2way41456926826.png",intern=TRUE)) character(0) > try(system("convert tmp/3lnoi1456926826.ps tmp/3lnoi1456926826.png",intern=TRUE)) character(0) > try(system("convert tmp/4d9tx1456926826.ps tmp/4d9tx1456926826.png",intern=TRUE)) character(0) > try(system("convert tmp/5pqac1456926826.ps tmp/5pqac1456926826.png",intern=TRUE)) character(0) > try(system("convert tmp/6v30t1456926826.ps tmp/6v30t1456926826.png",intern=TRUE)) character(0) > try(system("convert tmp/7c4ja1456926826.ps tmp/7c4ja1456926826.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.402 0.475 2.903