R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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(9.26,9.27,9.29,9.27,9.29,9.31,9.33,9.35,9.34,9.35,9.38,9.43,9.47,9.5,9.55,9.58,9.61,9.57,9.61,9.65,9.62,9.63,9.62,9.63,9.65,9.72,9.75,9.77,9.78,9.82,9.84,9.9,9.94,9.96,10.03,10.03,10.12,10.12,10.05,10.14,10.17,10.2,10.2,10.35,10.43,10.52,10.57,10.57,10.57,10.65,10.57,10.61,10.63,10.71,10.72,10.77,10.79,10.82,10.9,10.83,10.92,10.91,10.88,10.87,11,10.99,11.03,11.04,10.99,10.9,11,10.99,10.92,10.98,11.15,11.19,11.33,11.38,11.4,11.45,11.56,11.61,11.82,11.77,11.85,11.82,11.92,11.86,11.87,11.94,11.86,11.92,11.83,11.91,11.93,11.99,11.96,12.12,11.85,12.01,12.1,12.21,12.31,12.31,12.39,12.35,12.41,12.51,12.27,12.51,12.44,12.47,12.51,12.58,12.5,12.52,12.59,12.51,12.67,12.64,12.54,12.6,12.67,12.62,12.72,12.85,12.85,12.82,12.79,12.94,12.71,12.56) > 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) > if (par1 < 10) par1 = 10 > if (par1 > 5000) par1 = 5000 > library(lattice) > library(boot) Attaching package: 'boot' The following object(s) are masked from 'package:lattice': melanoma > 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')) ORDINARY NONPARAMETRIC BOOTSTRAP Call: boot(data = x, statistic = boot.stat, R = par1, stype = "i") Bootstrap Statistics : original bias std. error t1* 11.04015 0.01133939 0.10481057 t2* 10.95000 0.00110000 0.13184828 t3* 11.10000 -0.01700000 0.02296848 > postscript(file="/var/www/rcomp/tmp/1fw2r1321948235.ps",horizontal=F,onefile=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() null device 1 > postscript(file="/var/www/rcomp/tmp/27jmh1321948235.ps",horizontal=F,onefile=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() null device 1 > postscript(file="/var/www/rcomp/tmp/3pjyu1321948235.ps",horizontal=F,onefile=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() null device 1 > postscript(file="/var/www/rcomp/tmp/4lwv01321948235.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~r$t[,1],col='black',main='Density Plot',xlab='mean') > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/5gly81321948235.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~r$t[,2],col='black',main='Density Plot',xlab='median') > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/6z0al1321948235.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~r$t[,3],col='black',main='Density Plot',xlab='midrange') > dev.off() null device 1 > z <- data.frame(cbind(r$t[,1],r$t[,2],r$t[,3])) > colnames(z) <- list('mean','median','midrange') > postscript(file="/var/www/rcomp/tmp/78r6s1321948235.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > boxplot(z,notch=TRUE,ylab='simulated values',main='Bootstrap Simulation - Central Tendency') Warning message: In bxp(list(stats = c(10.8140151515152, 10.9837878787879, 11.0562878787879, : some notches went outside hinges ('box'): maybe set notch=FALSE > grid() > dev.off() null device 1 > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/8yffe1321948235.tab") > > try(system("convert tmp/1fw2r1321948235.ps tmp/1fw2r1321948235.png",intern=TRUE)) character(0) > try(system("convert tmp/27jmh1321948235.ps tmp/27jmh1321948235.png",intern=TRUE)) character(0) > try(system("convert tmp/3pjyu1321948235.ps tmp/3pjyu1321948235.png",intern=TRUE)) character(0) > try(system("convert tmp/4lwv01321948235.ps tmp/4lwv01321948235.png",intern=TRUE)) character(0) > try(system("convert tmp/5gly81321948235.ps tmp/5gly81321948235.png",intern=TRUE)) character(0) > try(system("convert tmp/6z0al1321948235.ps tmp/6z0al1321948235.png",intern=TRUE)) character(0) > try(system("convert tmp/78r6s1321948235.ps tmp/78r6s1321948235.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.61 0.23 2.80