R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" 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(1230,1360,1360,1250,1420,1390,1280,1330,1400,1370,1290,1500,1260,1360,1320,1300,1440,1360,1330,1420,1510,1280,1310,1460,1280,1370,1390,1390,1460,1410,1230,1260,1590,1250,1400,1450,1220,1290,1400,1400,1460,1450,1270,1260,1550,1230,1380,1490,1180,1190,1400,1380,1510,1400,1290,1200,1600,1220,1380,1450,1260,1130,1390,1380,1570,1320,1210,1190,1580,1150,1330,1420,1260,1040,1450,1360,1500,1240,1260,1220,1680,1210,1350,1480,1270,1040,1450,1310,1510,1160,1290,1230,1680,1190,1310,1480,1320,1050,1380,1320,1480,1150,1250,1260,1680,1150,1310,1470) > 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] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 1230 1260 1280 1220 1180 1260 1260 1270 1320 NA [2,] 1360 1360 1370 1290 1190 1130 1040 1040 1050 NA [3,] 1360 1320 1390 1400 1400 1390 1450 1450 1380 NA [4,] 1250 1300 1390 1400 1380 1380 1360 1310 1320 NA [5,] 1420 1440 1460 1460 1510 1570 1500 1510 1480 NA [6,] 1390 1360 1410 1450 1400 1320 1240 1160 1150 NA [7,] 1280 1330 1230 1270 1290 1210 1260 1290 1250 NA [8,] 1330 1420 1260 1260 1200 1190 1220 1230 1260 NA [9,] 1400 1510 1590 1550 1600 1580 1680 1680 1680 NA [10,] 1370 1280 1250 1230 1220 1150 1210 1190 1150 NA [11,] 1290 1310 1400 1380 1380 1330 1350 1310 1310 NA [12,] 1500 1460 1450 1490 1450 1420 1480 1480 1470 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 130 100 90 70 10 -130 -220 -230 -270 NA [2,] 0 -40 20 110 210 260 410 410 330 NA [3,] -110 -20 0 0 -20 -10 -90 -140 -60 NA [4,] 170 140 70 60 130 190 140 200 160 NA [5,] -30 -80 -50 -10 -110 -250 -260 -350 -330 NA [6,] -110 -30 -180 -180 -110 -110 20 130 100 NA [7,] 50 90 30 -10 -90 -20 -40 -60 10 NA [8,] 70 90 330 290 400 390 460 450 420 NA [9,] -30 -230 -340 -320 -380 -430 -470 -490 -530 NA [10,] -80 30 150 150 160 180 140 120 160 NA [11,] 210 150 50 110 70 90 130 170 160 NA [12,] -240 -180 -230 -310 -190 -160 -210 -160 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/1ggh01471256689.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/2obwp1471256689.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/3pt9g1471256689.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/4y1k81471256689.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,] 1180 1040 1360 1250 1420 1150 1210 1190 1400 1150 1290 1420 [2,] 1230 1050 1380 1310 1460 1240 1250 1220 1550 1190 1310 1450 [3,] 1260 1190 1390 1360 1480 1360 1270 1260 1590 1220 1330 1470 [4,] 1270 1360 1400 1380 1510 1400 1290 1260 1680 1250 1380 1480 [5,] 1320 1370 1400 1400 1570 1450 1330 1260 1680 1280 1400 1500 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1238.933 1026.733 1379.467 1323.133 1453.667 1275.733 1248.933 1238.933 [2,] 1281.067 1353.267 1400.533 1396.867 1506.333 1444.267 1291.067 1281.067 [,9] [,10] [,11] [,12] [1,] 1521.533 1188.4 1293.133 1454.2 [2,] 1658.467 1251.6 1366.867 1485.8 $out [1] 1320 1450 1450 1330 1420 1370 $group [1] 3 3 3 8 8 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1180, 1230, 1260, 1270, 1320, 1040, 1050, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5k8pt1471256689.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,] -270 -40 -140 70 -350 -180 -90 290 -530 120 50 -310 [2,] -220 20 -90 130 -260 -110 -40 290 -470 120 90 -235 [3,] 10 210 -20 140 -110 -110 -10 390 -380 150 130 -200 [4,] 90 330 -10 170 -50 20 30 420 -320 160 160 -170 [5,] 130 410 0 200 -10 130 90 460 -230 180 210 -160 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -153.2667 46.73333 -62.13333 118.9333 -220.6 -178.46667 -46.86667 [2,] 173.2667 373.26667 22.13333 161.0667 0.6 -41.53333 26.86667 [,8] [,9] [,10] [,11] [,12] [1,] 321.5333 -459 128.9333 93.13333 -236.3099 [2,] 458.4667 -301 171.0667 166.86667 -163.6901 $out [1] 60 70 90 -30 -80 30 $group [1] 4 8 8 9 10 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-270, -220, 10, 90, 130, -40, 20, 210, 330, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6v4cq1471256689.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,] 1230 1260 1230 1220 1180 1130 1040 1040 1050 NA [2,] 1285 1305 1270 1265 1210 1200 1230 1210 1200 NA [3,] 1360 1345 1390 1390 1380 1325 1305 1300 1315 NA [4,] 1395 1430 1430 1455 1425 1405 1465 1465 1425 NA [5,] 1500 1510 1590 1550 1600 1580 1680 1680 1680 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1309.828 1287.987 1317.023 1303.34 1281.937 1231.498 1197.815 1183.693 [2,] 1410.172 1402.013 1462.977 1476.66 1478.063 1418.502 1412.185 1416.307 [,9] [,10] [1,] 1212.376 NA [2,] 1417.624 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(1230, 1285, 1360, 1395, 1500, 1260, 1305, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7kpzx1471256689.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,] 1203.333 1190 1205.0 [2,] 1258.333 1260 1245.0 [3,] 1330.000 1345 1332.5 [4,] 1430.000 1430 1427.5 [5,] 1585.556 1590 1615.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1251.702 1267.462 1249.261 [2,] 1408.298 1422.538 1415.739 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1203.33333333333, 1258.33333333333, 1330, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ggh01471256689.ps tmp/1ggh01471256689.png",intern=TRUE)) character(0) > try(system("convert tmp/2obwp1471256689.ps tmp/2obwp1471256689.png",intern=TRUE)) character(0) > try(system("convert tmp/3pt9g1471256689.ps tmp/3pt9g1471256689.png",intern=TRUE)) character(0) > try(system("convert tmp/4y1k81471256689.ps tmp/4y1k81471256689.png",intern=TRUE)) character(0) > try(system("convert tmp/5k8pt1471256689.ps tmp/5k8pt1471256689.png",intern=TRUE)) character(0) > try(system("convert tmp/6v4cq1471256689.ps tmp/6v4cq1471256689.png",intern=TRUE)) character(0) > try(system("convert tmp/7kpzx1471256689.ps tmp/7kpzx1471256689.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.606 0.239 2.902