R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(4.27,4.06,4.58,3.23,3.65,3.45,3.03,2.11,1.7,2,1.8,1.59,-0.2,0.3,1.5,-0.1,0.2,-0.1,-0.3,-0.6,0.1,0.6,0.31,-0.1) > par1 = '4' > par1 <- as.numeric(par1) > (n <- length(x)) [1] 24 > (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 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 4.27 3.65 1.70 -0.2 0.2 0.10 NA [2,] 4.06 3.45 2.00 0.3 -0.1 0.60 NA [3,] 4.58 3.03 1.80 1.5 -0.3 0.31 NA [4,] 3.23 2.11 1.59 -0.1 -0.6 -0.10 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.21 -0.20 0.30 0.5 -0.3 0.50 NA [2,] 0.52 -0.42 -0.20 1.2 -0.2 -0.29 NA [3,] -1.35 -0.92 -0.21 -1.6 -0.3 -0.41 NA [4,] 0.42 -0.41 -1.79 0.3 0.7 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/1eyuz1352846484.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/2jm2h1352846484.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/3zvq11352846484.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/4nzhm1352846484.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,] -0.20 -0.10 -0.30 -0.600 [2,] 0.10 0.30 0.31 -0.100 [3,] 0.95 1.30 1.65 0.745 [4,] 3.65 3.45 3.03 2.110 [5,] 4.27 4.06 4.58 3.230 $n [1] 6 6 6 6 $conf [,1] [,2] [,3] [,4] [1,] -1.339865 -0.7318517 -0.1044879 -0.6805214 [2,] 3.239865 3.3318517 3.4044879 2.1705214 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" Warning message: In bxp(list(stats = c(-0.2, 0.1, 0.95, 3.65, 4.27, -0.1, 0.3, 1.3, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5tev11352846484.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,] -0.30 -0.42 -1.600 -0.41 [2,] -0.21 -0.29 -1.350 -0.41 [3,] 0.05 -0.20 -0.665 0.30 [4,] 0.50 0.52 -0.300 0.42 [5,] 0.50 1.20 -0.210 0.70 $n [1] 6 6 6 5 $conf [,1] [,2] [,3] [,4] [1,] -0.4079729 -0.7224762 -1.34228391 -0.2864759 [2,] 0.5079729 0.3224762 0.01228391 0.8864759 $out [1] -1.79 $group [1] 4 $names [1] "1" "2" "3" "4" Warning message: In bxp(list(stats = c(-0.3, -0.21, 0.0500000000000002, 0.5, 0.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6x3dq1352846484.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,] 3.230 2.11 1.590 -0.20 -0.60 -0.100 NA [2,] 3.645 2.57 1.645 -0.15 -0.45 0.000 NA [3,] 4.165 3.24 1.750 0.10 -0.20 0.205 NA [4,] 4.425 3.55 1.900 0.90 0.05 0.455 NA [5,] 4.580 3.65 2.000 1.50 0.20 0.600 NA $n [1] 4 4 4 4 4 4 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 3.5488 2.4658 1.54855 -0.7295 -0.595 -0.15445 NA [2,] 4.7812 4.0142 1.95145 0.9295 0.195 0.56445 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(3.23, 3.645, 4.165, 4.425, 4.58, 2.11, 2.57, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7k8ot1352846484.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,] 1.021667 0.7450 0.940000 [2,] 1.320833 0.8475 1.291875 [3,] 1.669167 1.1250 1.654375 [4,] 1.769167 1.4750 1.698125 [5,] 1.820000 1.6500 1.731250 $n [1] 4 4 4 $conf [,1] [,2] [,3] [1,] 1.314983 0.629275 1.333437 [2,] 2.023350 1.620725 1.975313 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.02166666666667, 1.32083333333333, 1.66916666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1eyuz1352846484.ps tmp/1eyuz1352846484.png",intern=TRUE)) character(0) > try(system("convert tmp/2jm2h1352846484.ps tmp/2jm2h1352846484.png",intern=TRUE)) character(0) > try(system("convert tmp/3zvq11352846484.ps tmp/3zvq11352846484.png",intern=TRUE)) character(0) > try(system("convert tmp/4nzhm1352846484.ps tmp/4nzhm1352846484.png",intern=TRUE)) character(0) > try(system("convert tmp/5tev11352846484.ps tmp/5tev11352846484.png",intern=TRUE)) character(0) > try(system("convert tmp/6x3dq1352846484.ps tmp/6x3dq1352846484.png",intern=TRUE)) character(0) > try(system("convert tmp/7k8ot1352846484.ps tmp/7k8ot1352846484.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.725 0.839 4.694