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(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,1.74,1.39,2.24,2.04,2.2,2.16,2.28,2.16,1.87,1.81,1.77,2.03,2.65) > 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] 61 > (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] 6 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 3.65 1.46 1.14 -0.65 1.74 2.65 [2,] 3.66 1.19 0.97 -0.40 1.39 NA [3,] 3.36 1.11 0.89 -0.40 2.24 NA [4,] 3.19 1.00 0.62 0.29 2.04 NA [5,] 2.81 1.18 0.36 0.56 2.20 NA [6,] 2.25 1.59 0.27 0.63 2.16 NA [7,] 2.32 1.51 0.34 0.46 2.28 NA [8,] 2.85 1.01 0.02 0.91 2.16 NA [9,] 2.75 0.90 -0.12 1.06 1.87 NA [10,] 2.78 0.63 0.09 1.28 1.81 NA [11,] 2.26 0.81 -0.11 1.52 1.77 NA [12,] 2.23 0.97 -0.38 1.50 2.03 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.01 -0.27 -0.17 0.25 -0.35 NA [2,] -0.30 -0.08 -0.08 0.00 0.85 NA [3,] -0.17 -0.11 -0.27 0.69 -0.20 NA [4,] -0.38 0.18 -0.26 0.27 0.16 NA [5,] -0.56 0.41 -0.09 0.07 -0.04 NA [6,] 0.07 -0.08 0.07 -0.17 0.12 NA [7,] 0.53 -0.50 -0.32 0.45 -0.12 NA [8,] -0.10 -0.11 -0.14 0.15 -0.29 NA [9,] 0.03 -0.27 0.21 0.22 -0.06 NA [10,] -0.52 0.18 -0.20 0.24 -0.04 NA [11,] -0.03 0.16 -0.27 -0.02 0.26 NA [12,] -0.77 0.17 -0.27 0.24 0.62 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/1dxlz1489315374.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/245kq1489315374.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/3vatc1489315374.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/4v5d41489315374.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] [,12] [1,] -0.65 0.97 -0.40 0.29 0.36 0.27 0.34 0.02 -0.12 0.09 -0.11 -0.38 [2,] 1.14 0.97 0.89 0.62 0.56 0.63 0.46 0.91 0.90 0.63 0.81 0.97 [3,] 1.60 1.19 1.11 1.00 1.18 1.59 1.51 1.01 1.06 1.28 1.52 1.50 [4,] 2.65 1.39 2.24 2.04 2.20 2.16 2.28 2.16 1.87 1.81 1.77 2.03 [5,] 3.65 1.39 3.36 3.19 2.81 2.25 2.32 2.85 2.75 2.78 2.26 2.23 $n [1] 6 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.6260012 0.8932291 0.1560934 -0.003368423 0.02118013 0.5089059 0.2239926 [2,] 2.5739988 1.4867709 2.0639066 2.003368423 2.33881987 2.6710941 2.7960074 [,8] [,9] [,10] [,11] [,12] [1,] 0.1267531 0.3746004 0.446215 0.8416664 0.7510067 [2,] 1.8932469 1.7453996 2.113785 2.1983336 2.2489933 $out [1] 3.66 -0.40 $group [1] 2 2 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.65, 1.14, 1.6, 2.65, 3.65, 0.97, 0.97, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5byjo1489315374.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] [,12] [1,] -0.35 -0.08 -0.27 -0.38 -0.09 -0.17 -0.50 -0.14 -0.27 -0.52 -0.27 -0.77 [2,] -0.27 -0.08 -0.20 -0.26 -0.09 -0.08 -0.32 -0.14 -0.06 -0.20 -0.03 -0.27 [3,] -0.17 -0.08 -0.17 0.16 -0.04 0.07 -0.12 -0.11 0.03 -0.04 -0.02 0.17 [4,] 0.01 0.00 -0.11 0.18 0.07 0.07 0.45 -0.10 0.21 0.18 0.16 0.24 [5,] 0.25 0.00 -0.11 0.27 0.07 0.12 0.53 -0.10 0.22 0.24 0.26 0.62 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.36784729 -0.1365278 -0.2335938 -0.1509029 -0.1530556 -0.03598962 [2,] 0.02784729 -0.0234722 -0.1064062 0.4709029 0.0730556 0.17598962 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.6640801 -0.1382639 -0.1607813 -0.308507 -0.1542535 -0.1903647 [2,] 0.4240801 -0.0817361 0.2207813 0.228507 0.1142535 0.5303647 $out [1] -0.30 0.85 0.69 -0.56 0.41 0.15 -0.29 $group [1] 2 2 3 5 5 8 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.35, -0.27, -0.17, 0.0100000000000002, 0.25, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/64z2l1489315374.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,] 2.230 0.630 -0.380 -0.650 1.390 2.65 [2,] 2.290 0.935 -0.045 -0.055 1.790 2.65 [3,] 2.795 1.060 0.305 0.595 2.035 2.65 [4,] 3.275 1.325 0.755 1.170 2.180 2.65 [5,] 3.660 1.590 1.140 1.520 2.280 2.65 $n [1] 12 12 12 12 12 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 2.345735 0.8821184 -0.05988537 0.03626928 1.857118 2.65 [2,] 3.244265 1.2378816 0.66988537 1.15373072 2.212882 2.65 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(2.23, 2.29, 2.795, 3.275, 3.66, 0.63, 0.935, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7k3ux1489315374.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.250 1.000 1.18000 [2,] 1.305 1.085 1.31000 [3,] 1.381 1.235 1.38250 [4,] 1.425 1.515 1.51750 [5,] 1.440 1.600 1.82125 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.326267 1.038874 1.287858 [2,] 1.435733 1.431126 1.477142 $out [1] 1.665 $group [1] 1 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.25, 1.305, 1.381, 1.425, 1.44, 1, 1.085, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1dxlz1489315374.ps tmp/1dxlz1489315374.png",intern=TRUE)) character(0) > try(system("convert tmp/245kq1489315374.ps tmp/245kq1489315374.png",intern=TRUE)) character(0) > try(system("convert tmp/3vatc1489315374.ps tmp/3vatc1489315374.png",intern=TRUE)) character(0) > try(system("convert tmp/4v5d41489315374.ps tmp/4v5d41489315374.png",intern=TRUE)) character(0) > try(system("convert tmp/5byjo1489315374.ps tmp/5byjo1489315374.png",intern=TRUE)) character(0) > try(system("convert tmp/64z2l1489315374.ps tmp/64z2l1489315374.png",intern=TRUE)) character(0) > try(system("convert tmp/7k3ux1489315374.ps tmp/7k3ux1489315374.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.452 0.248 2.745