R version 2.10.1 (2009-12-14) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(131.676 + ,135.050 + ,129.070 + ,137.792 + ,139.762 + ,142.917 + ,144.198 + ,142.648 + ,152.170 + ,136.022 + ,138.142 + ,138.135 + ,135.027 + ,132.911 + ,133.976 + ,137.012 + ,119.610 + ,118.106 + ,120.383 + ,133.185 + ,131.416 + ,134.248 + ,134.397 + ,127.728 + ,131.837 + ,125.955 + ,134.187 + ,143.291 + ,145.074 + ,149.812 + ,144.668 + ,147.253 + ,145.568 + ,155.564 + ,155.872 + ,156.323 + ,158.010 + ,155.598 + ,154.785 + ,157.294 + ,162.938 + ,157.283 + ,166.074 + ,169.282 + ,172.552 + ,174.055 + ,175.409 + ,173.696 + ,171.283 + ,173.322 + ,170.717 + ,174.229 + ,175.339 + ,173.511 + ,175.839 + ,173.816 + ,173.990 + ,174.777 + ,174.819 + ,176.726 + ,176.199 + ,180.952 + ,176.663 + ,182.346 + ,180.605 + ,182.497 + ,187.856 + ,190.020 + ,190.108 + ,193.288 + ,193.230 + ,199.068 + ,195.076 + ,191.563 + ,191.067 + ,186.665 + ,185.508 + ,184.371 + ,183.046 + ,175.714 + ,175.768 + ,171.029 + ,170.465 + ,170.102 + ,156.389 + ,124.291 + ,99.360 + ,86.675 + ,85.056 + ,128.236 + ,164.257 + ,162.401 + ,152.779 + ,156.005 + ,153.387 + ,153.190 + ,148.840 + ,144.211 + ,145.953 + ,145.542 + ,150.271 + ,147.489 + ,143.824 + ,134.754 + ,131.736 + ,126.304 + ,125.511 + ,125.495 + ,130.133 + ,126.257 + ,110.323 + ,98.417 + ,105.749 + ,120.665 + ,124.075 + ,127.245 + ,146.731 + ,144.979 + ,148.210 + ,144.670 + ,142.970 + ,142.524 + ,146.142 + ,146.522 + ,148.128 + ,148.798 + ,150.181 + ,152.388 + ,155.694 + ,160.662 + ,155.520 + ,158.262 + ,154.338 + ,158.196 + ,160.371 + ,154.856 + ,150.636 + ,145.899 + ,141.242 + ,140.834 + ,141.119 + ,139.104 + ,134.437 + ,129.425 + ,123.155 + ,119.273 + ,120.472 + ,121.523 + ,121.983 + ,123.658 + ,124.794 + ,124.827 + ,120.382 + ,117.395 + ,115.790 + ,114.283 + ,117.271 + ,117.448 + ,118.764 + ,120.550 + ,123.554 + ,125.412 + ,124.182 + ,119.828 + ,115.361 + ,114.226 + ,115.214 + ,115.864 + ,114.276 + ,113.469 + ,114.883 + ,114.172 + ,111.225 + ,112.149 + ,115.618 + ,118.002 + ,121.382 + ,120.663 + ,128.049) > 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* 145.1189 -0.393725 1.800318 t2* 144.2110 -0.585300 1.986220 t3* 142.0620 -0.636460 2.005018 > postscript(file="/var/yougetitorg/rcomp/tmp/1evwr1304452905.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/yougetitorg/rcomp/tmp/2rgzy1304452905.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/yougetitorg/rcomp/tmp/3sn7k1304452905.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/yougetitorg/rcomp/tmp/4cssz1304452905.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/yougetitorg/rcomp/tmp/5tbjf1304452905.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/yougetitorg/rcomp/tmp/66qxe1304452905.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/yougetitorg/rcomp/tmp/70k1u1304452905.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(141.069033519553, 143.645910614525, 144.737081005587, : some notches went outside hinges ('box'): maybe set notch=FALSE > grid() > dev.off() null device 1 > > #Note: the /var/yougetitorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/yougetitorg/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/yougetitorg/rcomp/tmp/8r4wg1304452905.tab") > > try(system("convert tmp/1evwr1304452905.ps tmp/1evwr1304452905.png",intern=TRUE)) character(0) > try(system("convert tmp/2rgzy1304452905.ps tmp/2rgzy1304452905.png",intern=TRUE)) character(0) > try(system("convert tmp/3sn7k1304452905.ps tmp/3sn7k1304452905.png",intern=TRUE)) character(0) > try(system("convert tmp/4cssz1304452905.ps tmp/4cssz1304452905.png",intern=TRUE)) character(0) > try(system("convert tmp/5tbjf1304452905.ps tmp/5tbjf1304452905.png",intern=TRUE)) character(0) > try(system("convert tmp/66qxe1304452905.ps tmp/66qxe1304452905.png",intern=TRUE)) character(0) > try(system("convert tmp/70k1u1304452905.ps tmp/70k1u1304452905.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.030 1.270 2.664