R version 2.12.1 (2010-12-16) 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(98.6,98.8,99.9,100.3,100.2,100.2,100.6,100.4,100.7,100.9,99.7,99.7,96.8,99.2,99.9,99.3,98.9,98.9,98.7,98.4,98.6,98.5,98.1,98.3,98.1,97.9,99.1,98.5,98.2,97.8,98,98,97.6,97.6,97.6,97.5,96.1,96.1,96.3,96.3,96.3,96,96,95.2,96,96.1,95.3,95.1,94.8,94.5,94.7,94.8,94.5,94.5,92.8,92.8,94.5,94.4,94.2,94.1,92.9,93.3,93.6,93.6,94,94,94.2,93.3,93,93,94.7,95.6,95.8,96,95.4,95.3,94.4,94.4,94.3,93.9,94.5,93.6,93.9,93.9,93.7,94.6,94.4,94,91.1,91.1,90.7,90.8,89.8,90.7,90.3,89.7,89,88.4,89.3,89.3,89.3,89.3,88.4,89.4,91.3,90.9,91,89.3,88.1,89,90.1,90.6,90.6,90.2,89.5,90.5,90.4,89.7,90,90.2,89.3,89.6,89.8,89.4,89.3,89.4,89.5,89.2,90,88,88.3,89.1) > 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* 94.1447 -0.00669697 0.30448331 t2* 94.4000 -0.06400000 0.22247220 t3* 94.4500 -0.02900000 0.08212112 > postscript(file="/var/www/rcomp/tmp/1rjab1323189856.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/2zuuv1323189856.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/3ut0o1323189856.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/4mdxm1323189856.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/512qb1323189856.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/6vbos1323189856.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/7rujm1323189856.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(93.4636363636364, 93.939393939394, 94.1382575757576, : 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/8qzuh1323189856.tab") > > try(system("convert tmp/1rjab1323189856.ps tmp/1rjab1323189856.png",intern=TRUE)) character(0) > try(system("convert tmp/2zuuv1323189856.ps tmp/2zuuv1323189856.png",intern=TRUE)) character(0) > try(system("convert tmp/3ut0o1323189856.ps tmp/3ut0o1323189856.png",intern=TRUE)) character(0) > try(system("convert tmp/4mdxm1323189856.ps tmp/4mdxm1323189856.png",intern=TRUE)) character(0) > try(system("convert tmp/512qb1323189856.ps tmp/512qb1323189856.png",intern=TRUE)) character(0) > try(system("convert tmp/6vbos1323189856.ps tmp/6vbos1323189856.png",intern=TRUE)) character(0) > try(system("convert tmp/7rujm1323189856.ps tmp/7rujm1323189856.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.884 0.552 4.280