x <- c(2.14,2.45,2.52,2.3,2.25,2.06,1.99,2.25,2.26,2.36,2.3,2.19,2.31,2.21,2.21,2.26,2.18,2.21,2.33,2.12,2.08,1.97,2.09,2.11,2.24,2.45,2.68,2.73,2.76,2.83,3.16,3.22,3.22,3.34,3.35,3.42,3.58,3.71,3.68,3.83,3.94,3.88,4.03,4.15,4.32,4.4,4.37,4.14,4.11,4.16,3.98,4.13,3.76,3.66,3.85,4.03,4.31,4.58,4.46,4.41,3.84,2.84,2.66,2.17,1.43,1.47,1.29,1.23,1.09,0.94,0.76,0.67)
par2 = '12'
par1 = '50'
#'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/1qakd1260701191.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/2yw8w1260701191.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/3ebju1260701191.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/4efta1260701191.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/520sl1260701191.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/61paf1260701191.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/7fl5q1260701191.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/8krzh1260701191.tab") 

try(system("convert tmp/1qakd1260701191.ps tmp/1qakd1260701191.png",intern=TRUE))
try(system("convert tmp/2yw8w1260701191.ps tmp/2yw8w1260701191.png",intern=TRUE))
try(system("convert tmp/3ebju1260701191.ps tmp/3ebju1260701191.png",intern=TRUE))
try(system("convert tmp/4efta1260701191.ps tmp/4efta1260701191.png",intern=TRUE))
try(system("convert tmp/520sl1260701191.ps tmp/520sl1260701191.png",intern=TRUE))
try(system("convert tmp/61paf1260701191.ps tmp/61paf1260701191.png",intern=TRUE))
try(system("convert tmp/7fl5q1260701191.ps tmp/7fl5q1260701191.png",intern=TRUE))

