x <- c(1.43,1.43,1.43,1.43,1.43,1.43,1.44,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.57,1.58,1.58,1.58,1.58,1.59,1.6,1.6,1.61,1.61,1.61,1.62,1.63,1.63,1.64,1.64,1.64,1.64,1.64,1.65,1.65,1.65,1.65,1.65,1.66,1.66,1.67,1.68,1.68,1.68,1.68,1.69,1.7,1.7,1.71,1.72,1.73,1.74,1.74,1.75,1.75,1.75,1.76,1.79,1.83)
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)
if (par1 < 10) par1 = 10
if (par1 > 5000) par1 = 5000
library(lattice)
library(boot)
boot.stat <- function(s,i)
{
s.mean <- mean(s[i])
s.median <- median(s[i])
s.midrange <- (max(s[i]) + min(s[i])) / 2
c(s.mean, s.median, s.midrange)
}
(r <- boot(x,boot.stat, R=par1, stype='i'))
postscript(file="/var/www/html/rcomp/tmp/1k5581209578778.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/2ajpy1209578778.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/3zyvg1209578778.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/4t2ga1209578778.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/5lyey1209578778.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/6htl71209578778.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/7kphi1209578778.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 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/8vbi71209578778.tab") 

system("convert tmp/1k5581209578778.ps tmp/1k5581209578778.png")
system("convert tmp/2ajpy1209578778.ps tmp/2ajpy1209578778.png")
system("convert tmp/3zyvg1209578778.ps tmp/3zyvg1209578778.png")
system("convert tmp/4t2ga1209578778.ps tmp/4t2ga1209578778.png")
system("convert tmp/5lyey1209578778.ps tmp/5lyey1209578778.png")
system("convert tmp/6htl71209578778.ps tmp/6htl71209578778.png")
system("convert tmp/7kphi1209578778.ps tmp/7kphi1209578778.png")

