R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 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(950,775,805,680,705,755,715,860,900,1010,925,650,1060,1050,1025,1085,1160,1310,1445,1445,1615,1650,1255,1175,1300,1280,1390,1340,1110,1325,1265,1150,1430,1655,1570,1345,1430,1260,1495,1125,895,1085,870,1185,1455,1540,1615,1200,1260,1095,1160,1095,1300,1215,1245,1350,1300,1280,1270,1065,1340,1265,1155,930,880,925,980,1015,1040,1365,1160,1115,1630,1225,1200,1265,1140,1270,1445,1305,1665,1830,1690,1520) > 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] 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,] 950 1060 1300 1430 1260 1340 1630 NA [2,] 775 1050 1280 1260 1095 1265 1225 NA [3,] 805 1025 1390 1495 1160 1155 1200 NA [4,] 680 1085 1340 1125 1095 930 1265 NA [5,] 705 1160 1110 895 1300 880 1140 NA [6,] 755 1310 1325 1085 1215 925 1270 NA [7,] 715 1445 1265 870 1245 980 1445 NA [8,] 860 1445 1150 1185 1350 1015 1305 NA [9,] 900 1615 1430 1455 1300 1040 1665 NA [10,] 1010 1650 1655 1540 1280 1365 1830 NA [11,] 925 1255 1570 1615 1270 1160 1690 NA [12,] 650 1175 1345 1200 1065 1115 1520 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -175 -10 -20 -170 -165 -75 -405 NA [2,] 30 -25 110 235 65 -110 -25 NA [3,] -125 60 -50 -370 -65 -225 65 NA [4,] 25 75 -230 -230 205 -50 -125 NA [5,] 50 150 215 190 -85 45 130 NA [6,] -40 135 -60 -215 30 55 175 NA [7,] 145 0 -115 315 105 35 -140 NA [8,] 40 170 280 270 -50 25 360 NA [9,] 110 35 225 85 -20 325 165 NA [10,] -85 -395 -85 75 -10 -205 -140 NA [11,] -275 -80 -225 -415 -205 -45 -170 NA [12,] 410 125 85 60 275 515 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/1tjlf1424952543.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/2ya1p1424952543.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/34w6z1424952543.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/425hg1424952543.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,] 950 1050.0 805 930.0 705.0 755 715 860.0 900 1010.0 925.0 1065.0 [2,] 1160 1072.5 1090 1007.5 887.5 1005 925 1082.5 1170 1322.5 1207.5 1090.0 [3,] 1300 1225.0 1160 1095.0 1110.0 1215 1245 1185.0 1430 1540.0 1270.0 1175.0 [4,] 1385 1262.5 1295 1195.0 1150.0 1290 1355 1327.5 1535 1652.5 1592.5 1272.5 [5,] 1630 1280.0 1495 1340.0 1300.0 1325 1445 1445.0 1665 1830.0 1690.0 1520.0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1165.634 1111.535 1037.577 983.028 953.2392 1044.803 988.2109 1038.69 [2,] 1434.366 1338.465 1282.423 1206.972 1266.7608 1385.197 1501.7891 1331.31 [,9] [,10] [,11] [,12] [1,] 1212.028 1342.929 1040.084 1066.014 [2,] 1647.972 1737.071 1499.916 1283.986 $out [1] 775 680 650 $group [1] 2 4 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(950, 1160, 1300, 1385, 1630, 1050, 1072.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5avrt1424952543.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,] -175.0 -110.0 -370 -230.0 -85.0 -215 -140.0 -50.0 -20 -205.0 -415 60 [2,] -172.5 -25.0 -175 -177.5 47.5 -50 -57.5 32.5 60 -172.5 -250 85 [3,] -165.0 30.0 -65 -50.0 130.0 30 35.0 170.0 110 -85.0 -205 200 [4,] -47.5 87.5 5 50.0 170.0 95 125.0 275.0 195 -47.5 -125 410 [5,] -10.0 235.0 65 205.0 215.0 175 315.0 360.0 325 75.0 -45 515 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -239.64798 -37.18319 -172.4931 -185.85933 56.84498 -56.59166 -73.98606 [2,] -90.35202 97.18319 42.4931 85.85933 203.15502 116.59166 143.98606 [,8] [,9] [,10] [,11] [,12] [1,] 25.18291 29.38018 -159.64798 -279.648 -9.635497 [2,] 314.81709 190.61982 -10.35202 -130.352 409.635497 $out [1] -405 -395 $group [1] 1 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-175, -172.5, -165, -47.5, -10, -110, -25, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6wzfp1424952543.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,] 650.0 1025.0 1110.0 870 1065.0 880.0 1140.0 NA [2,] 710.0 1072.5 1272.5 1105 1127.5 955.0 1245.0 NA [3,] 790.0 1215.0 1332.5 1230 1252.5 1077.5 1375.0 NA [4,] 912.5 1445.0 1410.0 1475 1290.0 1212.5 1647.5 NA [5,] 1010.0 1650.0 1570.0 1615 1350.0 1365.0 1830.0 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 697.6384 1045.1 1269.785 1061.241 1178.383 960.0525 1191.417 NA [2,] 882.3616 1384.9 1395.215 1398.759 1326.617 1194.9475 1558.583 NA $out [1] 1655 $group [1] 3 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(650, 710, 790, 912.5, 1010, 1025, 1072.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/70zpc1424952543.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,] 1027.143 1095.0 1018.750 [2,] 1131.071 1167.5 1143.750 [3,] 1164.286 1220.0 1186.875 [4,] 1312.500 1285.0 1312.500 [5,] 1475.714 1430.0 1487.500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1081.535 1166.407 1109.907 [2,] 1247.037 1273.593 1263.843 $out [1] 1540 $group [1] 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1027.14285714286, 1131.07142857143, 1164.28571428571, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1tjlf1424952543.ps tmp/1tjlf1424952543.png",intern=TRUE)) character(0) > try(system("convert tmp/2ya1p1424952543.ps tmp/2ya1p1424952543.png",intern=TRUE)) character(0) > try(system("convert tmp/34w6z1424952543.ps tmp/34w6z1424952543.png",intern=TRUE)) character(0) > try(system("convert tmp/425hg1424952543.ps tmp/425hg1424952543.png",intern=TRUE)) character(0) > try(system("convert tmp/5avrt1424952543.ps tmp/5avrt1424952543.png",intern=TRUE)) character(0) > try(system("convert tmp/6wzfp1424952543.ps tmp/6wzfp1424952543.png",intern=TRUE)) character(0) > try(system("convert tmp/70zpc1424952543.ps tmp/70zpc1424952543.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.556 0.425 3.010