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(2.32,1.93,0.62,0.6,-0.37,-1.1,-1.68,-0.77,-1.2,-0.97,-0.12,0.26,0.62,0.7,1.65,1.79,2.28,2.46,2.57,2.32,2.91,3.01,2.87,3.11,3.22,3.38,3.52,3.41,3.35,3.68,3.75,3.6,3.56,3.57,3.85,3.48,3.65,3.66,3.36,3.19,2.81,2.25,2.32,2.85,2.75,2.78,2.26,2.23,1.46,1.19,1.11,1,1.18,1.59,1.51,1.01,0.9,0.63,0.81,0.97,1.14,0.97,0.89,0.62,0.36,0.27,0.34,0.02,-0.12,0.09,-0.11,-0.38,-0.65,-0.4,-0.4,0.29,0.56,0.63,0.46,0.91,1.06,1.28,1.52,1.5) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2.32 0.62 3.22 3.65 1.46 1.14 -0.65 NA [2,] 1.93 0.70 3.38 3.66 1.19 0.97 -0.40 NA [3,] 0.62 1.65 3.52 3.36 1.11 0.89 -0.40 NA [4,] 0.60 1.79 3.41 3.19 1.00 0.62 0.29 NA [5,] -0.37 2.28 3.35 2.81 1.18 0.36 0.56 NA [6,] -1.10 2.46 3.68 2.25 1.59 0.27 0.63 NA [7,] -1.68 2.57 3.75 2.32 1.51 0.34 0.46 NA [8,] -0.77 2.32 3.60 2.85 1.01 0.02 0.91 NA [9,] -1.20 2.91 3.56 2.75 0.90 -0.12 1.06 NA [10,] -0.97 3.01 3.57 2.78 0.63 0.09 1.28 NA [11,] -0.12 2.87 3.85 2.26 0.81 -0.11 1.52 NA [12,] 0.26 3.11 3.48 2.23 0.97 -0.38 1.50 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -0.39 0.08 0.16 0.01 -0.27 -0.17 0.25 NA [2,] -1.31 0.95 0.14 -0.30 -0.08 -0.08 0.00 NA [3,] -0.02 0.14 -0.11 -0.17 -0.11 -0.27 0.69 NA [4,] -0.97 0.49 -0.06 -0.38 0.18 -0.26 0.27 NA [5,] -0.73 0.18 0.33 -0.56 0.41 -0.09 0.07 NA [6,] -0.58 0.11 0.07 0.07 -0.08 0.07 -0.17 NA [7,] 0.91 -0.25 -0.15 0.53 -0.50 -0.32 0.45 NA [8,] -0.43 0.59 -0.04 -0.10 -0.11 -0.14 0.15 NA [9,] 0.23 0.10 0.01 0.03 -0.27 0.21 0.22 NA [10,] 0.85 -0.14 0.28 -0.52 0.18 -0.20 0.24 NA [11,] 0.38 0.24 -0.37 -0.03 0.16 -0.27 -0.02 NA [12,] 0.36 0.11 0.17 -0.77 0.17 -0.27 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/1plcl1484007863.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/2v9pr1484007863.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/3pvoy1484007863.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/4nj391484007863.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] [,11] [1,] -0.65 -0.400 -0.400 0.29 -0.370 -1.100 -1.680 -0.770 -1.20 -0.970 -0.120 [2,] 0.88 0.835 0.755 0.61 0.460 0.450 0.400 0.465 0.39 0.360 0.350 [3,] 1.46 1.190 1.110 1.00 1.180 1.590 1.510 1.010 1.06 1.280 1.520 [4,] 2.77 2.655 2.505 2.49 2.545 2.355 2.445 2.585 2.83 2.895 2.565 [5,] 3.65 3.660 3.520 3.41 3.350 3.680 3.750 3.600 3.56 3.570 3.850 [,12] [1,] -0.380 [2,] 0.615 [3,] 1.500 [4,] 2.670 [5,] 3.480 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.3313225 0.1031254 0.06492823 -0.1227057 -0.06512836 0.4523647 0.288759 [2,] 2.5886775 2.2768746 2.15507177 2.1227057 2.42512836 2.7276353 2.731241 [,8] [,9] [,10] [,11] [,12] [1,] -0.2560298 -0.3971286 -0.2338611 0.1972377 0.2727872 [2,] 2.2760298 2.5171286 2.7938611 2.8427623 2.7272128 $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(-0.65, 0.88, 1.46, 2.77, 3.65, -0.4, 0.835, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5sm2r1484007863.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.39 -0.30 -0.27 -0.970 -0.730 -0.170 -0.500 -0.140 -0.270 -0.52 -0.37 [2,] -0.22 -0.19 -0.14 -0.320 -0.325 -0.125 -0.285 -0.125 0.020 -0.17 -0.15 [3,] 0.01 -0.08 -0.11 -0.060 0.070 0.070 -0.150 -0.100 0.100 0.18 -0.02 [4,] 0.12 0.07 0.06 0.225 0.255 0.070 0.490 0.055 0.215 0.26 0.20 [5,] 0.25 0.14 0.14 0.490 0.410 0.110 0.910 0.150 0.230 0.85 0.38 [,12] [1,] -0.77 [2,] -0.27 [3,] 0.14 [4,] 0.17 [5,] 0.36 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.1930425 -0.23526781 -0.229436773 -0.3854652 -0.2763666 -0.04645085 [2,] 0.2130425 0.07526781 0.009436773 0.2654652 0.4163666 0.18645085 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.6128175 -0.207493096 -0.01645085 -0.07678906 -0.2290144 -0.1438142 [2,] 0.3128175 0.007493096 0.21645085 0.43678906 0.1890144 0.4238142 $out [1] -1.31 0.95 0.69 -0.58 -0.43 0.59 $group [1] 2 2 3 6 8 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.39, -0.22, 0.0100000000000002, 0.12, 0.25, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6wzm91484007863.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,] -1.680 0.62 3.220 2.230 0.630 -0.380 -0.650 NA [2,] -1.035 1.72 3.395 2.290 0.935 -0.045 -0.055 NA [3,] -0.245 2.39 3.540 2.795 1.060 0.305 0.595 NA [4,] 0.610 2.89 3.640 3.275 1.325 0.755 1.170 NA [5,] 2.320 3.11 3.850 3.660 1.590 1.140 1.520 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.9952955 1.856355 3.428254 2.345735 0.8821184 -0.05988537 0.03626928 [2,] 0.5052955 2.923645 3.651746 3.244265 1.2378816 0.66988537 1.15373072 [,8] [1,] NA [2,] NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(-1.68, -1.035, -0.245, 0.61, 2.32, 0.62, 1.72, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7lrjr1484007863.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,] 1.324286 1.000 1.40250 [2,] 1.414286 1.085 1.48000 [3,] 1.510000 1.235 1.58000 [4,] 1.589286 1.505 1.63625 [5,] 1.680000 1.590 1.82500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.430181 1.043435 1.508733 [2,] 1.589819 1.426565 1.651267 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.32428571428571, 1.41428571428571, 1.51, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1plcl1484007863.ps tmp/1plcl1484007863.png",intern=TRUE)) character(0) > try(system("convert tmp/2v9pr1484007863.ps tmp/2v9pr1484007863.png",intern=TRUE)) character(0) > try(system("convert tmp/3pvoy1484007863.ps tmp/3pvoy1484007863.png",intern=TRUE)) character(0) > try(system("convert tmp/4nj391484007863.ps tmp/4nj391484007863.png",intern=TRUE)) character(0) > try(system("convert tmp/5sm2r1484007863.ps tmp/5sm2r1484007863.png",intern=TRUE)) character(0) > try(system("convert tmp/6wzm91484007863.ps tmp/6wzm91484007863.png",intern=TRUE)) character(0) > try(system("convert tmp/7lrjr1484007863.ps tmp/7lrjr1484007863.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.632 0.152 2.828