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(85.95,86.41,86.42,86.81,86.71,86.7,87.07,86.96,87.04,87.5,88.32,88.56,88.92,89.56,90.21,90.42,91.23,91.73,92.21,91.65,91.8,91.63,91.09,90.89,90.98,91.29,90.77,90.96,90.89,90.72,90.66,90.94,90.7,90.74,90.98,91.13,91.54,91.93,92.27,92.59,92.96,92.95,92.99,93.05,93.34,93.47,93.59,93.96,94.49,95.04,95.52,95.75,96.07,96.37,96.48,96.4,96.66,96.81,97.19,97.23,97.94,98.52,98.73,98.8,98.77,98.54,98.72,99.15,99.32,99.5,99.39,99.4,99.37,99.69,99.83,99.79,99.94,100.11,100.21,100.15,100.21,100.13,100.2,100.36,100.5,100.66,100.72,100.41,100.3,100.38,100.55,100.17,100.09,100.22,100.09,99.98) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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] 8 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 85.95 88.92 90.98 91.54 94.49 97.94 99.37 100.50 NA [2,] 86.41 89.56 91.29 91.93 95.04 98.52 99.69 100.66 NA [3,] 86.42 90.21 90.77 92.27 95.52 98.73 99.83 100.72 NA [4,] 86.81 90.42 90.96 92.59 95.75 98.80 99.79 100.41 NA [5,] 86.71 91.23 90.89 92.96 96.07 98.77 99.94 100.30 NA [6,] 86.70 91.73 90.72 92.95 96.37 98.54 100.11 100.38 NA [7,] 87.07 92.21 90.66 92.99 96.48 98.72 100.21 100.55 NA [8,] 86.96 91.65 90.94 93.05 96.40 99.15 100.15 100.17 NA [9,] 87.04 91.80 90.70 93.34 96.66 99.32 100.21 100.09 NA [10,] 87.50 91.63 90.74 93.47 96.81 99.50 100.13 100.22 NA [11,] 88.32 91.09 90.98 93.59 97.19 99.39 100.20 100.09 NA [12,] 88.56 90.89 91.13 93.96 97.23 99.40 100.36 99.98 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 0.46 0.64 0.31 0.39 0.55 0.58 0.32 0.16 NA [2,] 0.01 0.65 -0.52 0.34 0.48 0.21 0.14 0.06 NA [3,] 0.39 0.21 0.19 0.32 0.23 0.07 -0.04 -0.31 NA [4,] -0.10 0.81 -0.07 0.37 0.32 -0.03 0.15 -0.11 NA [5,] -0.01 0.50 -0.17 -0.01 0.30 -0.23 0.17 0.08 NA [6,] 0.37 0.48 -0.06 0.04 0.11 0.18 0.10 0.17 NA [7,] -0.11 -0.56 0.28 0.06 -0.08 0.43 -0.06 -0.38 NA [8,] 0.08 0.15 -0.24 0.29 0.26 0.17 0.06 -0.08 NA [9,] 0.46 -0.17 0.04 0.13 0.15 0.18 -0.08 0.13 NA [10,] 0.82 -0.54 0.24 0.12 0.38 -0.11 0.07 -0.13 NA [11,] 0.24 -0.20 0.15 0.37 0.04 0.01 0.16 -0.11 NA [12,] 0.36 0.09 0.41 0.53 0.71 -0.03 0.14 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/1mnx61444991979.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/227hw1444991979.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/3xhe31444991979.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/47d4d1444991979.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,] 85.950 86.410 86.420 86.810 86.710 86.700 87.070 86.960 87.040 [2,] 89.950 90.425 90.490 90.690 91.060 91.225 91.435 91.295 91.250 [3,] 93.015 93.485 93.895 94.170 94.515 94.660 94.735 94.725 95.000 [4,] 98.655 99.105 99.280 99.295 99.355 99.325 99.465 99.650 99.705 [5,] 100.500 100.660 100.720 100.410 100.300 100.380 100.550 100.170 100.210 [,10] [,11] [,12] [1,] 87.500 88.320 88.560 [2,] 91.185 91.035 91.010 [3,] 95.140 95.390 95.595 [4,] 99.815 99.740 99.690 [5,] 100.220 100.200 100.360 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 88.15226 88.63623 88.98478 89.36312 89.88129 90.13522 90.24933 90.05778 [2,] 97.87774 98.33377 98.80522 98.97688 99.14871 99.18478 99.22067 99.39222 [,9] [,10] [,11] [,12] [1,] 90.27692 90.31916 90.52726 90.74623 [2,] 99.72308 99.96084 100.25274 100.44377 $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(85.95, 89.95, 93.015, 98.655, 100.5, 86.41, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5vt2z1444991979.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,] 0.160 -0.520 -0.310 -0.110 -0.230 -0.060 -0.560 -0.240 -0.170 -0.540 [2,] 0.315 0.035 0.015 -0.085 -0.090 0.070 -0.245 -0.010 -0.020 -0.120 [3,] 0.425 0.175 0.200 0.060 0.035 0.140 -0.070 0.115 0.130 0.095 [4,] 0.565 0.410 0.275 0.345 0.235 0.275 0.170 0.215 0.165 0.310 [5,] 0.640 0.650 0.390 0.810 0.500 0.480 0.430 0.290 0.180 0.820 [,11] [,12] [1,] -0.200 -0.030 [2,] -0.050 0.115 [3,] 0.095 0.360 [4,] 0.200 0.470 [5,] 0.370 0.710 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.2853464 -0.03448038 0.05476027 -0.1802042 -0.1465497 0.02548406 [2,] 0.5646536 0.38448038 0.34523973 0.3002042 0.2165497 0.25451594 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.301825 -0.01068823 0.02665634 -0.1452042 -0.04465359 0.1479997 [2,] 0.161825 0.24068823 0.23334366 0.3352042 0.23465359 0.5720003 $out [1] 0.46 $group [1] 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.159999999999997, 0.314999999999998, 0.424999999999997, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ea7n1444991979.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] [1,] 85.950 88.920 90.660 91.540 94.490 97.940 99.370 99.980 NA [2,] 86.560 90.315 90.730 92.430 95.635 98.630 99.810 100.130 NA [3,] 86.885 91.160 90.915 92.975 96.385 98.785 100.120 100.340 NA [4,] 87.285 91.690 90.980 93.405 96.735 99.355 100.205 100.525 NA [5,] 88.320 92.210 91.290 93.960 97.230 99.500 100.360 100.720 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 86.55432 90.53285 90.80097 92.5303 95.88328 98.45432 99.93984 100.1598 [2,] 87.21568 91.78715 91.02903 93.4197 96.88672 99.11568 100.30016 100.5202 [,9] [1,] NA [2,] NA $out [1] 88.56 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(85.95, 86.56, 86.885, 87.285, 88.32, 88.92, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/787jg1444991979.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,] 93.71125 93.0150 94.38125 [2,] 94.37500 94.0325 94.88563 [3,] 94.74813 94.6925 95.25625 [4,] 94.94750 95.0700 95.44687 [5,] 95.18875 95.5950 95.53250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 94.48700 94.21929 95.00026 [2,] 95.00925 95.16571 95.51224 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(93.71125, 94.375, 94.748125, 94.9475, 95.18875, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1mnx61444991979.ps tmp/1mnx61444991979.png",intern=TRUE)) character(0) > try(system("convert tmp/227hw1444991979.ps tmp/227hw1444991979.png",intern=TRUE)) character(0) > try(system("convert tmp/3xhe31444991979.ps tmp/3xhe31444991979.png",intern=TRUE)) character(0) > try(system("convert tmp/47d4d1444991979.ps tmp/47d4d1444991979.png",intern=TRUE)) character(0) > try(system("convert tmp/5vt2z1444991979.ps tmp/5vt2z1444991979.png",intern=TRUE)) character(0) > try(system("convert tmp/6ea7n1444991979.ps tmp/6ea7n1444991979.png",intern=TRUE)) character(0) > try(system("convert tmp/787jg1444991979.ps tmp/787jg1444991979.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.449 0.475 2.946