source('/home/pw/wessanet/cretab')



myrfcuid = 'r0382442'

x <- c(13663,11635,9606,8784.5,9415.5,10418,11344.5,11271,11895,12152.5,12731,12951,10692,8563.5,6217,5562,6294.5,7422,9254.5,10607,11268,12041,12962.5,12200.5,10400.5,8765,7000,6677,7318,7999,8762,9696,10373,10682.5,10935.5,10815.5,8669,7079.5,5640,5238.5,5777.5,6479,7290,7343,7810.5,8171.5,8532,8719,7281.5,5923.5,4837,4675.5,4585.5,5083,5766,6201,6778,7393.5,7849.5,8282.5,7610,6192.5,4693.5,4869,5149,5648.5,6230.5,7032,7727,8087.5,8443,9002,7717.5,6374.5,4995.5,4655,5198,5501,6119.5,6922,7390,7466.5,7773,7865,6567,5132.5,3656.5,3623,4045.5,4617,5374,6022.5,6464.5,7058,7484.5,7955,6801,5499,4179.5,4305.5,3304,5773.5,6419.5,6938,7760,8224,8381,8667,7304.5,5565.5,4023,3932.5,4508.5,5491,6284)
par1 = '12'
par1 <- '12'
#'GNU S' R Code compiled by R2WASP v. 1.2.327 (Tue, 16 Aug 2016 15:26:56 +0200)
#Author: root
#To cite this work: Wessa P., (2015), Mean Plot (v1.0.5) 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)
x <- na.omit(x)
(n <- length(x))
(np <- floor(n / par1))
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
arr
darr
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="/home/pw/wessanet/rcomp/tmp/16o121481035339.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()
postscript(file="/home/pw/wessanet/rcomp/tmp/29qqf1481035339.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()
postscript(file="/home/pw/wessanet/rcomp/tmp/3zk111481035339.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()
postscript(file="/home/pw/wessanet/rcomp/tmp/47lh11481035339.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'))
dev.off()
postscript(file="/home/pw/wessanet/rcomp/tmp/5lwj71481035339.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'))
dev.off()
postscript(file="/home/pw/wessanet/rcomp/tmp/6gckz1481035339.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'))
dev.off()
postscript(file="/home/pw/wessanet/rcomp/tmp/7agjm1481035339.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'))
dev.off()

try(system("convert /home/pw/wessanet/rcomp/tmp/16o121481035339.ps /home/pw/wessanet/rcomp/tmp/16o121481035339.png",intern=TRUE))
try(system("convert /home/pw/wessanet/rcomp/tmp/29qqf1481035339.ps /home/pw/wessanet/rcomp/tmp/29qqf1481035339.png",intern=TRUE))
try(system("convert /home/pw/wessanet/rcomp/tmp/3zk111481035339.ps /home/pw/wessanet/rcomp/tmp/3zk111481035339.png",intern=TRUE))
try(system("convert /home/pw/wessanet/rcomp/tmp/47lh11481035339.ps /home/pw/wessanet/rcomp/tmp/47lh11481035339.png",intern=TRUE))
try(system("convert /home/pw/wessanet/rcomp/tmp/5lwj71481035339.ps /home/pw/wessanet/rcomp/tmp/5lwj71481035339.png",intern=TRUE))
try(system("convert /home/pw/wessanet/rcomp/tmp/6gckz1481035339.ps /home/pw/wessanet/rcomp/tmp/6gckz1481035339.png",intern=TRUE))
try(system("convert /home/pw/wessanet/rcomp/tmp/7agjm1481035339.ps /home/pw/wessanet/rcomp/tmp/7agjm1481035339.png",intern=TRUE))
