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(1844.33,1845.39,1861.84,1862.85,1869.46,1870.8,1870.8,1871.52,1875.52,1880.38,1885.05,1886.42,1886.42,1891.65,1903.11,1905.29,1904.26,1905.37,1905.37,1905.12,1908.62,1915.08,1916.36,1916.68,1916.24,1922.05,1922.63,1922.47,1920.64,1920.66,1920.66,1921.19,1921.44,1921.73,1921.81,1921.81,1921.81,1921.48,1917.07,1912.64,1901.15,1898.12,1900.02,1900.02,1900.82,1901.9,1902.19,1901.84,1903.73,1889.7,1891.27,1894.48,1894.27,1893.98,1893.98,1895.62,1901.72,1905.4,1898.14,1898.09,1855.87,1868.53,1865.71,1872.59,1875.95,1875.95,1875.95,1878.08,1878.26,1876.39,1876.77,1876.88) > 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] 72 > (np <- floor(n / par1)) [1] 6 > 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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1844.33 1886.42 1916.24 1921.81 1903.73 1855.87 NA [2,] 1845.39 1891.65 1922.05 1921.48 1889.70 1868.53 NA [3,] 1861.84 1903.11 1922.63 1917.07 1891.27 1865.71 NA [4,] 1862.85 1905.29 1922.47 1912.64 1894.48 1872.59 NA [5,] 1869.46 1904.26 1920.64 1901.15 1894.27 1875.95 NA [6,] 1870.80 1905.37 1920.66 1898.12 1893.98 1875.95 NA [7,] 1870.80 1905.37 1920.66 1900.02 1893.98 1875.95 NA [8,] 1871.52 1905.12 1921.19 1900.02 1895.62 1878.08 NA [9,] 1875.52 1908.62 1921.44 1900.82 1901.72 1878.26 NA [10,] 1880.38 1915.08 1921.73 1901.90 1905.40 1876.39 NA [11,] 1885.05 1916.36 1921.81 1902.19 1898.14 1876.77 NA [12,] 1886.42 1916.68 1921.81 1901.84 1898.09 1876.88 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.06 5.23 5.81 -0.33 -14.03 12.66 NA [2,] 16.45 11.46 0.58 -4.41 1.57 -2.82 NA [3,] 1.01 2.18 -0.16 -4.43 3.21 6.88 NA [4,] 6.61 -1.03 -1.83 -11.49 -0.21 3.36 NA [5,] 1.34 1.11 0.02 -3.03 -0.29 0.00 NA [6,] 0.00 0.00 0.00 1.90 0.00 0.00 NA [7,] 0.72 -0.25 0.53 0.00 1.64 2.13 NA [8,] 4.00 3.50 0.25 0.80 6.10 0.18 NA [9,] 4.86 6.46 0.29 1.08 3.68 -1.87 NA [10,] 4.67 1.28 0.08 0.29 -7.26 0.38 NA [11,] 1.37 0.32 0.00 -0.35 -0.05 0.11 NA [12,] 0.00 -0.44 0.00 1.89 -42.22 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/1x1qz1445113103.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/2k1sb1445113103.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/3w9881445113103.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/4j19u1445113103.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,] 1844.330 1845.390 1861.84 1862.850 1869.46 1870.80 1870.80 1871.52 1875.52 [2,] 1855.870 1868.530 1865.71 1872.590 1875.95 1875.95 1875.95 1878.08 1878.26 [3,] 1895.075 1890.675 1897.19 1899.885 1897.71 1896.05 1897.00 1897.82 1901.27 [4,] 1916.240 1921.480 1917.07 1912.640 1904.26 1905.37 1905.37 1905.12 1908.62 [5,] 1921.810 1922.050 1922.63 1922.470 1920.64 1920.66 1920.66 1921.19 1921.44 [,10] [,11] [,12] [1,] 1876.39 1876.770 1876.880 [2,] 1880.38 1885.050 1886.420 [3,] 1903.65 1900.165 1899.965 [4,] 1915.08 1916.360 1916.680 [5,] 1921.73 1921.810 1921.810 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1856.134 1856.521 1864.061 1874.051 1879.449 1877.073 1878.023 1880.378 [2,] 1934.016 1924.829 1930.319 1925.719 1915.971 1915.027 1915.977 1915.262 [,9] [,10] [,11] [,12] [1,] 1881.687 1881.267 1879.969 1880.446 [2,] 1920.853 1926.033 1920.361 1919.484 $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(1844.33, 1855.87, 1895.075, 1916.24, 1921.81, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5wpv11445113103.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,] -0.330 -4.410 -4.430 -1.83 -0.29 0 -0.250 0.18 -1.87 0.080 -0.350 -0.44 [2,] -0.330 -2.820 -0.160 -1.83 -0.29 0 0.000 0.25 0.29 0.080 -0.050 -0.44 [3,] 3.145 1.075 1.595 -0.62 0.01 0 0.625 2.15 2.38 0.335 0.055 0.00 [4,] 5.810 11.460 3.210 3.36 1.11 0 1.640 4.00 4.86 1.280 0.320 0.00 [5,] 12.660 16.450 6.880 6.61 1.34 0 2.130 6.10 6.46 1.280 0.320 0.00 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.8154983 -8.136061 -0.5787588 -3.967718 -0.8930452 0 -0.432853 [2,] 7.1054983 10.286061 3.7687588 2.727718 0.9130452 0 1.682853 [,8] [,9] [,10] [,11] [,12] [1,] -0.2688711 -0.5677976 -0.4390388 -0.183662 -0.3109029 [2,] 4.5688711 5.3277976 1.1090388 0.293662 0.3109029 $out [1] -14.03 -11.49 -3.03 1.90 4.67 -7.26 1.37 1.89 -42.22 $group [1] 1 4 5 6 10 10 11 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.329999999999927, -0.329999999999927, 3.1450000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6vaqx1445113103.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] [1,] 1844.330 1891.650 1920.640 1898.120 1889.70 1865.710 NA [2,] 1862.345 1903.685 1920.660 1900.420 1893.98 1870.560 NA [3,] 1870.800 1905.330 1921.585 1901.870 1895.05 1875.950 NA [4,] 1877.950 1911.850 1921.930 1914.855 1899.93 1876.825 NA [5,] 1886.420 1916.680 1922.630 1921.810 1905.40 1878.260 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1863.682 1901.606 1921.006 1895.286 1892.336 1873.092 NA [2,] 1877.918 1909.054 1922.164 1908.454 1897.764 1878.808 NA $out [1] 1886.42 1916.24 1855.87 $group [1] 2 3 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1844.33, 1862.345, 1870.8, 1877.95, 1886.42, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7w9sc1445113103.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,] 1888.067 1895.075 1888.310 [2,] 1893.876 1896.525 1892.126 [3,] 1894.758 1897.765 1893.539 [4,] 1898.892 1900.065 1897.304 [5,] 1900.287 1903.650 1901.154 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1892.471 1896.15 1891.177 [2,] 1897.046 1899.38 1895.900 $out [1] 1890.675 $group [1] 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1888.06666666667, 1893.87583333333, 1894.75833333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1x1qz1445113103.ps tmp/1x1qz1445113103.png",intern=TRUE)) character(0) > try(system("convert tmp/2k1sb1445113103.ps tmp/2k1sb1445113103.png",intern=TRUE)) character(0) > try(system("convert tmp/3w9881445113103.ps tmp/3w9881445113103.png",intern=TRUE)) character(0) > try(system("convert tmp/4j19u1445113103.ps tmp/4j19u1445113103.png",intern=TRUE)) character(0) > try(system("convert tmp/5wpv11445113103.ps tmp/5wpv11445113103.png",intern=TRUE)) character(0) > try(system("convert tmp/6vaqx1445113103.ps tmp/6vaqx1445113103.png",intern=TRUE)) character(0) > try(system("convert tmp/7w9sc1445113103.ps tmp/7w9sc1445113103.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.589 0.455 3.067