R version 3.0.1 (2013-05-16) -- "Good Sport" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-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(1620,1560,1650,1320,1710,1680,1800,1860,2070,1800,1710,2130,1800,1350,1590,1200,1680,1380,1830,1650,1740,1950,1920,2280,1650,1380,1530,1110,1590,1230,1740,1650,1470,2100,1890,2160,1620,1500,1350,1110,1470,1320,1800,1740,1500,2010,1860,2400,1920,1170,1170,1170,1380,1380,1860,1710,1530,1920,1770,2550,2010,1170,1230,1020,1410,1620,2040,2010,1620,1890,1680,2400,1830,1470,1320,990,1470,1770,2070,1950,1440,2070,1620,2490,2070,1500,1380,930,1470,1410,2130,2130,1620,2100,1560,2430,2070,1530,1170,810,1590,1530,2010,2310,1710,1920,1440,2490) > 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] 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,] 1620 1800 1650 1620 1920 2010 1830 2070 2070 NA [2,] 1560 1350 1380 1500 1170 1170 1470 1500 1530 NA [3,] 1650 1590 1530 1350 1170 1230 1320 1380 1170 NA [4,] 1320 1200 1110 1110 1170 1020 990 930 810 NA [5,] 1710 1680 1590 1470 1380 1410 1470 1470 1590 NA [6,] 1680 1380 1230 1320 1380 1620 1770 1410 1530 NA [7,] 1800 1830 1740 1800 1860 2040 2070 2130 2010 NA [8,] 1860 1650 1650 1740 1710 2010 1950 2130 2310 NA [9,] 2070 1740 1470 1500 1530 1620 1440 1620 1710 NA [10,] 1800 1950 2100 2010 1920 1890 2070 2100 1920 NA [11,] 1710 1920 1890 1860 1770 1680 1620 1560 1440 NA [12,] 2130 2280 2160 2400 2550 2400 2490 2430 2490 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] -60 -450 -270 -120 -750 -840 -360 -570 -540 NA [2,] 90 240 150 -150 0 60 -150 -120 -360 NA [3,] -330 -390 -420 -240 0 -210 -330 -450 -360 NA [4,] 390 480 480 360 210 390 480 540 780 NA [5,] -30 -300 -360 -150 0 210 300 -60 -60 NA [6,] 120 450 510 480 480 420 300 720 480 NA [7,] 60 -180 -90 -60 -150 -30 -120 0 300 NA [8,] 210 90 -180 -240 -180 -390 -510 -510 -600 NA [9,] -270 210 630 510 390 270 630 480 210 NA [10,] -90 -30 -210 -150 -150 -210 -450 -540 -480 NA [11,] 420 360 270 540 780 720 870 870 1050 NA [12,] -330 -630 -540 -480 -540 -570 -420 -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/fisher/rcomp/tmp/1rqwv1375797208.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/fisher/rcomp/tmp/27c9j1375797208.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/fisher/rcomp/tmp/3qlr31375797208.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/fisher/rcomp/tmp/4yvjw1375797208.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,] 1620 1170 1170 810 1380 1230 1740 1650 1440 1800 1440 2130 [2,] 1650 1350 1230 990 1470 1380 1800 1710 1500 1920 1620 2280 [3,] 1830 1470 1350 1110 1470 1410 1860 1860 1620 1950 1710 2400 [4,] 2010 1500 1530 1170 1590 1620 2040 2010 1710 2070 1860 2490 [5,] 2070 1560 1650 1320 1710 1770 2130 2310 1740 2100 1920 2550 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 1640.4 1391 1192 1015.2 1406.8 1283.6 1733.6 1702 1509.4 1871 1583.6 [2,] 2019.6 1549 1508 1204.8 1533.2 1536.4 1986.4 2018 1730.6 2029 1836.4 [,12] [1,] 2289.4 [2,] 2510.6 $out [1] 2070 $group [1] 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1620, 1650, 1830, 2010, 2070, 1170, 1350, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/509cr1375797208.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,] -840 -360 -450 360 -360 420 -180 -600 210 -540 270 -630 [2,] -570 -150 -390 390 -150 420 -120 -510 210 -450 420 -555 [3,] -450 0 -330 480 -60 480 -60 -240 390 -210 720 -510 [4,] -270 90 -240 480 0 480 0 -180 510 -150 870 -390 [5,] -60 240 -210 540 210 510 60 210 630 -30 1050 -330 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] -608 -126.4 -409 432.6 -139 448.4 -123.2 -413.8 232 -368 483 -602.1714 [2,] -292 126.4 -251 527.4 19 511.6 3.2 -66.2 548 -52 957 -417.8286 $out [1] 0 210 780 300 120 300 720 300 -270 $group [1] 3 4 4 5 6 6 6 7 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-840, -570, -450, -270, -60, -360, -150, 0, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6579e1375797208.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,] 1560 1200 1110 1110 1170 1020 990 930 810 NA [2,] 1635 1485 1425 1410 1275 1320 1455 1440 1485 NA [3,] 1710 1710 1620 1560 1620 1650 1695 1590 1650 NA [4,] 1830 1875 1815 1830 1890 2010 2010 2115 2040 NA [5,] 2070 2280 2160 2400 2550 2400 2490 2430 2490 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1621.059 1532.118 1442.118 1368.435 1339.494 1335.286 1441.861 1282.128 [2,] 1798.941 1887.882 1797.882 1751.565 1900.506 1964.714 1948.139 1897.872 [,9] [,10] [1,] 1396.861 NA [2,] 1903.139 NA $out [1] 1320 2130 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(1560, 1635, 1710, 1830, 2070, 1200, 1485, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/7cse21375797208.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,] 1073.333 1110 1080.0 [2,] 1441.667 1440 1462.5 [3,] 1675.000 1665 1672.5 [4,] 1905.000 1860 1890.0 [5,] 2370.000 2400 2385.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1463.671 1473.435 1477.514 [2,] 1886.329 1856.565 1867.486 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > try(system("convert tmp/1rqwv1375797208.ps tmp/1rqwv1375797208.png",intern=TRUE)) character(0) > try(system("convert tmp/27c9j1375797208.ps tmp/27c9j1375797208.png",intern=TRUE)) character(0) > try(system("convert tmp/3qlr31375797208.ps tmp/3qlr31375797208.png",intern=TRUE)) character(0) > try(system("convert tmp/4yvjw1375797208.ps tmp/4yvjw1375797208.png",intern=TRUE)) character(0) > try(system("convert tmp/509cr1375797208.ps tmp/509cr1375797208.png",intern=TRUE)) character(0) > try(system("convert tmp/6579e1375797208.ps tmp/6579e1375797208.png",intern=TRUE)) character(0) > try(system("convert tmp/7cse21375797208.ps tmp/7cse21375797208.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.217 0.747 3.950