x <- c(1.25,1.25,1.26,1.26,1.26,1.26,1.27,1.27,1.29,1.31,1.32,1.32,1.33,1.33,1.32,1.32,1.31,1.3,1.31,1.29,1.3,1.3,1.32,1.31,1.35,1.35,1.36,1.37,1.37,1.37,1.32,1.32,1.31,1.31,1.34,1.31,1.26,1.27,1.24,1.25,1.27,1.25,1.26,1.27,1.26,1.26,1.28,1.27,1.28,1.27,1.26,1.27,1.27,1.28,1.27,1.26,1.3,1.31,1.28,1.29,1.31,1.29,1.29,1.32,1.3,1.29,1.31,1.29,1.33,1.35,1.32,1.33,1.34,1.34,1.33,1.33,1.35,1.32)
par2 = '12'
par1 = '750'
#'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
#Author: Prof. Dr. P. Wessa
#To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
#Source of accompanying publication: Office for Research, Development, and Education
#Technical description: Write here your technical program description (don't use hard returns!)
par1 <- as.numeric(par1)
par2 <- as.numeric(par2)
if (par1 < 10) par1 = 10
if (par1 > 5000) par1 = 5000
if (par2 < 3) par2 = 3
if (par2 > length(x)) par2 = length(x)
library(lattice)
library(boot)
boot.stat <- function(s)
{
s.mean <- mean(s)
s.median <- median(s)
s.midrange <- (max(s) + min(s)) / 2
c(s.mean, s.median, s.midrange)
}
(r <- tsboot(x, boot.stat, R=par1, l=12, sim='fixed'))
postscript(file="/var/www/html/rcomp/tmp/1lh7g1260713560.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) 
plot(r$t[,1],type='p',ylab='simulated values',main='Simulation of Mean')
grid()
dev.off()
postscript(file="/var/www/html/rcomp/tmp/2qk741260713560.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) 
plot(r$t[,2],type='p',ylab='simulated values',main='Simulation of Median')
grid()
dev.off()
postscript(file="/var/www/html/rcomp/tmp/3btos1260713560.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) 
plot(r$t[,3],type='p',ylab='simulated values',main='Simulation of Midrange')
grid()
dev.off()
postscript(file="/var/www/html/rcomp/tmp/4et5w1260713560.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) 
densityplot(~r$t[,1],col='black',main='Density Plot',xlab='mean')
dev.off()
postscript(file="/var/www/html/rcomp/tmp/5ovcp1260713560.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) 
densityplot(~r$t[,2],col='black',main='Density Plot',xlab='median')
dev.off()
postscript(file="/var/www/html/rcomp/tmp/6yf8x1260713560.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) 
densityplot(~r$t[,3],col='black',main='Density Plot',xlab='midrange')
dev.off()
z <- data.frame(cbind(r$t[,1],r$t[,2],r$t[,3]))
colnames(z) <- list('mean','median','midrange')
postscript(file="/var/www/html/rcomp/tmp/7kik41260713560.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) 
boxplot(z,notch=TRUE,ylab='simulated values',main='Bootstrap Simulation - Central Tendency')
grid()
dev.off()

#Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
load(file="/var/www/html/rcomp/createtable")

a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Estimation Results of Blocked Bootstrap',6,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'statistic',header=TRUE)
a<-table.element(a,'Q1',header=TRUE)
a<-table.element(a,'Estimate',header=TRUE)
a<-table.element(a,'Q3',header=TRUE)
a<-table.element(a,'S.D.',header=TRUE)
a<-table.element(a,'IQR',header=TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'mean',header=TRUE)
q1 <- quantile(r$t[,1],0.25)[[1]]
q3 <- quantile(r$t[,1],0.75)[[1]]
a<-table.element(a,q1)
a<-table.element(a,r$t0[1])
a<-table.element(a,q3)
a<-table.element(a,sqrt(var(r$t[,1])))
a<-table.element(a,q3-q1)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'median',header=TRUE)
q1 <- quantile(r$t[,2],0.25)[[1]]
q3 <- quantile(r$t[,2],0.75)[[1]]
a<-table.element(a,q1)
a<-table.element(a,r$t0[2])
a<-table.element(a,q3)
a<-table.element(a,sqrt(var(r$t[,2])))
a<-table.element(a,q3-q1)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'midrange',header=TRUE)
q1 <- quantile(r$t[,3],0.25)[[1]]
q3 <- quantile(r$t[,3],0.75)[[1]]
a<-table.element(a,q1)
a<-table.element(a,r$t0[3])
a<-table.element(a,q3)
a<-table.element(a,sqrt(var(r$t[,3])))
a<-table.element(a,q3-q1)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file="/var/www/html/rcomp/tmp/86aam1260713560.tab") 

try(system("convert tmp/1lh7g1260713560.ps tmp/1lh7g1260713560.png",intern=TRUE))
try(system("convert tmp/2qk741260713560.ps tmp/2qk741260713560.png",intern=TRUE))
try(system("convert tmp/3btos1260713560.ps tmp/3btos1260713560.png",intern=TRUE))
try(system("convert tmp/4et5w1260713560.ps tmp/4et5w1260713560.png",intern=TRUE))
try(system("convert tmp/5ovcp1260713560.ps tmp/5ovcp1260713560.png",intern=TRUE))
try(system("convert tmp/6yf8x1260713560.ps tmp/6yf8x1260713560.png",intern=TRUE))
try(system("convert tmp/7kik41260713560.ps tmp/7kik41260713560.png",intern=TRUE))

