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(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 = '4' > par1 <- '4' > #'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] 72 > (np <- floor(n / par1)) [1] 18 > 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] 18 18 18 18 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,] 1060 1160 1615 1300 1110 1430 1430 895 1455 1260 1300 1300 1340 880 [2,] 1050 1310 1650 1280 1325 1655 1260 1085 1540 1095 1215 1280 1265 925 [3,] 1025 1445 1255 1390 1265 1570 1495 870 1615 1160 1245 1270 1155 980 [4,] 1085 1445 1175 1340 1150 1345 1125 1185 1200 1095 1350 1065 930 1015 [,15] [,16] [,17] [,18] [,19] [1,] 1040 1630 1140 1665 NA [2,] 1365 1225 1270 1830 NA [3,] 1160 1200 1445 1690 NA [4,] 1115 1265 1305 1520 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,] -10 150 35 -20 215 225 -170 190 85 -165 -85 -20 -75 45 [2,] -25 135 -395 110 -60 -85 235 -215 75 65 30 -10 -110 55 [3,] 60 0 -80 -50 -115 -225 -370 315 -415 -65 105 -205 -225 35 [4,] 75 170 125 -230 280 85 -230 270 60 205 -50 275 -50 25 [,15] [,16] [,17] [,18] [,19] [1,] 325 -405 130 165 NA [2,] -205 -25 175 -140 NA [3,] -45 65 -140 -170 NA [4,] 515 -125 360 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/1u41x1413113372.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/2fj4o1413113372.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/33daa1413113372.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/4orgu1413113372.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] [1,] 880 1050 870 930 [2,] 1110 1215 1160 1095 [3,] 1300 1275 1260 1180 [4,] 1430 1365 1445 1340 [5,] 1665 1540 1690 1520 $n [1] 18 18 18 18 $conf [,1] [,2] [,3] [,4] [1,] 1180.829 1219.139 1153.863 1088.76 [2,] 1419.171 1330.861 1366.137 1271.24 $out [1] 1650 1655 925 1830 $group [1] 2 2 2 2 $names [1] "1" "2" "3" "4" Warning message: In bxp(list(stats = c(880, 1110, 1300, 1430, 1665, 1050, 1215, 1275, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5wsgo1413113372.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] [1,] -405 -215.0 -415.0 -230 [2,] -75 -110.0 -205.0 -50 [3,] 40 -17.5 -72.5 85 [4,] 165 75.0 35.0 270 [5,] 325 235.0 315.0 515 $n [1] 18 18 18 17 $conf [,1] [,2] [,3] [,4] [1,] -49.3783 -86.39577 -161.8783 -37.62601 [2,] 129.3783 51.39577 16.8783 207.62601 $out [1] -395 $group [1] 2 $names [1] "1" "2" "3" "4" > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6vwvx1413113372.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] [,11] [1,] 1025.0 1160.0 1175.0 1280 1110.0 1345.0 1125.0 870.0 1200.0 1095.0 1215.0 [2,] 1037.5 1235.0 1215.0 1290 1130.0 1387.5 1192.5 882.5 1327.5 1095.0 1230.0 [3,] 1055.0 1377.5 1435.0 1320 1207.5 1500.0 1345.0 990.0 1497.5 1127.5 1272.5 [4,] 1072.5 1445.0 1632.5 1365 1295.0 1612.5 1462.5 1135.0 1577.5 1210.0 1325.0 [5,] 1085.0 1445.0 1650.0 1390 1325.0 1655.0 1495.0 1185.0 1615.0 1260.0 1350.0 [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [1,] 1065.0 930.0 880.0 1040.0 1200.0 1140.0 1520.0 NA [2,] 1167.5 1042.5 902.5 1077.5 1212.5 1205.0 1592.5 NA [3,] 1275.0 1210.0 952.5 1137.5 1245.0 1287.5 1677.5 NA [4,] 1290.0 1302.5 997.5 1262.5 1447.5 1375.0 1760.0 NA [5,] 1300.0 1340.0 1015.0 1365.0 1630.0 1445.0 1830.0 NA $n [1] 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 1027.35 1211.6 1105.175 1260.75 1077.15 1322.25 1131.7 790.525 1300 [2,] 1082.65 1543.4 1764.825 1379.25 1337.85 1677.75 1558.3 1189.475 1695 [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [1,] 1036.65 1197.45 1178.225 1004.6 877.45 991.35 1059.35 1153.2 1545.175 [2,] 1218.35 1347.55 1371.775 1415.4 1027.55 1283.65 1430.65 1421.8 1809.825 [,19] [1,] NA [2,] NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" NA Warning message: In bxp(list(stats = c(1025, 1037.5, 1055, 1072.5, 1085, 1160, 1235, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7f1y31413113372.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,] 1206.111 1180.0 1215.625 [2,] 1242.222 1220.0 1244.688 [3,] 1284.583 1267.5 1280.000 [4,] 1301.667 1287.5 1294.375 [5,] 1312.500 1300.0 1302.500 $n [1] 4 4 4 $conf [,1] [,2] [,3] [1,] 1237.622 1214.175 1240.747 [2,] 1331.544 1320.825 1319.253 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1206.11111111111, 1242.22222222222, 1284.58333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1u41x1413113372.ps tmp/1u41x1413113372.png",intern=TRUE)) character(0) > try(system("convert tmp/2fj4o1413113372.ps tmp/2fj4o1413113372.png",intern=TRUE)) character(0) > try(system("convert tmp/33daa1413113372.ps tmp/33daa1413113372.png",intern=TRUE)) character(0) > try(system("convert tmp/4orgu1413113372.ps tmp/4orgu1413113372.png",intern=TRUE)) character(0) > try(system("convert tmp/5wsgo1413113372.ps tmp/5wsgo1413113372.png",intern=TRUE)) character(0) > try(system("convert tmp/6vwvx1413113372.ps tmp/6vwvx1413113372.png",intern=TRUE)) character(0) > try(system("convert tmp/7f1y31413113372.ps tmp/7f1y31413113372.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.382 0.372 2.787