R version 2.15.3 (2013-03-01) -- "Security Blanket" Copyright (C) 2013 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-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(0.66,0.67,0.67,0.67,0.67,0.67,0.67,0.67,0.67,0.67,0.67,0.67,0.67,0.69,0.7,0.7,0.7,0.7,0.7,0.7,0.71,0.71,0.71,0.71,0.71,0.71,0.71,0.71,0.72,0.72,0.72,0.72,0.73,0.73,0.73,0.73,0.73,0.73,0.73,0.73,0.73,0.73,0.73,0.73,0.74,0.75,0.75,0.75,0.75,0.76,0.76,0.76,0.77,0.77,0.78,0.78,0.78,0.78,0.79,0.79,0.79,0.8,0.8,0.8,0.8,0.81,0.8,0.81,0.82,0.82,0.82,0.82) > par3 = '0' > par2 = '5' > par1 = '50' > par3 <- '0' > par2 <- '5' > par1 <- '50' > #'GNU S' R Code compiled by R2WASP v. 1.2.327 () > #Author: root > #To cite this work: Wessa P., (2013), Bootstrap Plot for Central Tendency (v1.0.11) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_bootstrapplot1.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > # > par1 <- as.numeric(par1) > par2 <- as.numeric(par2) > if (par3 == '0') bw <- NULL > if (par3 != '0') bw <- as.numeric(par3) > if (par1 < 10) par1 = 10 > if (par1 > 5000) par1 = 5000 > library(modeest) This is package 'modeest' written by Paul PONCET. For a complete list of functions, use 'library(help = "modeest")' or 'help.start()'. > 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 + s.mode <- mlv(s[i], method='mfv')$M + s.kernelmode <- mlv(s[i], method='kernel', bw=bw)$M + c(s.mean, s.median, s.midrange, s.mode, s.kernelmode) + } > (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* 0.7341667 -0.001255556 0.005298396 t2* 0.7300000 -0.002600000 0.005823948 t3* 0.7400000 0.001900000 0.002451572 t4* 0.7000000 0.003866667 0.031782709 t5* 0.7213871 -0.001163850 0.023164468 There were 26 warnings (use warnings() to see them) > postscript(file="/var/fisher/rcomp/tmp/1c6761369235838.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/fisher/rcomp/tmp/2ywys1369235838.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/fisher/rcomp/tmp/34byz1369235838.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/fisher/rcomp/tmp/4410j1369235838.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(r$t[,4],type='p',ylab='simulated values',main='Simulation of Mode') > grid() > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5zu9c1369235838.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(r$t[,5],type='p',ylab='simulated values',main='Simulation of Mode of Kernel Density') > grid() > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6msuw1369235838.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/fisher/rcomp/tmp/7b9yi1369235838.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/fisher/rcomp/tmp/816zu1369235838.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 > postscript(file="/var/fisher/rcomp/tmp/9vuec1369235838.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~r$t[,4],col='black',main='Density Plot',xlab='mode') > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/10qif41369235838.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~r$t[,5],col='black',main='Density Plot',xlab='mode of kernel dens.') > dev.off() null device 1 > z <- data.frame(cbind(r$t[,1],r$t[,2],r$t[,3],r$t[,4],r$t[,5])) > colnames(z) <- list('mean','median','midrange','mode','mode k.dens') > postscript(file="/var/fisher/rcomp/tmp/112e2m1369235838.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(0.720833333333333, 0.729305555555556, 0.733194444444444, : some notches went outside hinges ('box'): maybe set notch=FALSE > grid() > dev.off() null device 1 > > #Note: the /var/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Estimation Results of Bootstrap',10,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'statistic',header=TRUE) > a<-table.element(a,'P1',header=TRUE) > a<-table.element(a,'P5',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,'P95',header=TRUE) > a<-table.element(a,'P99',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]] > p01 <- quantile(r$t[,1],0.01)[[1]] > p05 <- quantile(r$t[,1],0.05)[[1]] > p95 <- quantile(r$t[,1],0.95)[[1]] > p99 <- quantile(r$t[,1],0.99)[[1]] > a<-table.element(a,signif(p01,par2)) > a<-table.element(a,signif(p05,par2)) > a<-table.element(a,signif(q1,par2)) > a<-table.element(a,signif(r$t0[1],par2)) > a<-table.element(a,signif(q3,par2)) > a<-table.element(a,signif(p95,par2)) > a<-table.element(a,signif(p99,par2)) > a<-table.element( a,signif( sqrt(var(r$t[,1])),par2 ) ) > a<-table.element(a,signif(q3-q1,par2)) > 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]] > p01 <- quantile(r$t[,2],0.01)[[1]] > p05 <- quantile(r$t[,2],0.05)[[1]] > p95 <- quantile(r$t[,2],0.95)[[1]] > p99 <- quantile(r$t[,2],0.99)[[1]] > a<-table.element(a,signif(p01,par2)) > a<-table.element(a,signif(p05,par2)) > a<-table.element(a,signif(q1,par2)) > a<-table.element(a,signif(r$t0[2],par2)) > a<-table.element(a,signif(q3,par2)) > a<-table.element(a,signif(p95,par2)) > a<-table.element(a,signif(p99,par2)) > a<-table.element(a,signif(sqrt(var(r$t[,2])),par2)) > a<-table.element(a,signif(q3-q1,par2)) > 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]] > p01 <- quantile(r$t[,3],0.01)[[1]] > p05 <- quantile(r$t[,3],0.05)[[1]] > p95 <- quantile(r$t[,3],0.95)[[1]] > p99 <- quantile(r$t[,3],0.99)[[1]] > a<-table.element(a,signif(p01,par2)) > a<-table.element(a,signif(p05,par2)) > a<-table.element(a,signif(q1,par2)) > a<-table.element(a,signif(r$t0[3],par2)) > a<-table.element(a,signif(q3,par2)) > a<-table.element(a,signif(p95,par2)) > a<-table.element(a,signif(p99,par2)) > a<-table.element(a,signif(sqrt(var(r$t[,3])),par2)) > a<-table.element(a,signif(q3-q1,par2)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'mode',header=TRUE) > q1 <- quantile(r$t[,4],0.25)[[1]] > q3 <- quantile(r$t[,4],0.75)[[1]] > p01 <- quantile(r$t[,4],0.01)[[1]] > p05 <- quantile(r$t[,4],0.05)[[1]] > p95 <- quantile(r$t[,4],0.95)[[1]] > p99 <- quantile(r$t[,4],0.99)[[1]] > a<-table.element(a,signif(p01,par2)) > a<-table.element(a,signif(p05,par2)) > a<-table.element(a,signif(q1,par2)) > a<-table.element(a,signif(r$t0[4],par2)) > a<-table.element(a,signif(q3,par2)) > a<-table.element(a,signif(p95,par2)) > a<-table.element(a,signif(p99,par2)) > a<-table.element(a,signif(sqrt(var(r$t[,4])),par2)) > a<-table.element(a,signif(q3-q1,par2)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'mode k.dens',header=TRUE) > q1 <- quantile(r$t[,5],0.25)[[1]] > q3 <- quantile(r$t[,5],0.75)[[1]] > p01 <- quantile(r$t[,5],0.01)[[1]] > p05 <- quantile(r$t[,5],0.05)[[1]] > p95 <- quantile(r$t[,5],0.95)[[1]] > p99 <- quantile(r$t[,5],0.99)[[1]] > a<-table.element(a,signif(p01,par2)) > a<-table.element(a,signif(p05,par2)) > a<-table.element(a,signif(q1,par2)) > a<-table.element(a,signif(r$t0[5],par2)) > a<-table.element(a,signif(q3,par2)) > a<-table.element(a,signif(p95,par2)) > a<-table.element(a,signif(p99,par2)) > a<-table.element(a,signif(sqrt(var(r$t[,5])),par2)) > a<-table.element(a,signif(q3-q1,par2)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/fisher/rcomp/tmp/12sua91369235838.tab") > > try(system("convert tmp/1c6761369235838.ps tmp/1c6761369235838.png",intern=TRUE)) character(0) > try(system("convert tmp/2ywys1369235838.ps tmp/2ywys1369235838.png",intern=TRUE)) character(0) > try(system("convert tmp/34byz1369235838.ps tmp/34byz1369235838.png",intern=TRUE)) character(0) > try(system("convert tmp/4410j1369235838.ps tmp/4410j1369235838.png",intern=TRUE)) character(0) > try(system("convert tmp/5zu9c1369235838.ps tmp/5zu9c1369235838.png",intern=TRUE)) character(0) > try(system("convert tmp/6msuw1369235838.ps tmp/6msuw1369235838.png",intern=TRUE)) character(0) > try(system("convert tmp/7b9yi1369235838.ps tmp/7b9yi1369235838.png",intern=TRUE)) character(0) > try(system("convert tmp/816zu1369235838.ps tmp/816zu1369235838.png",intern=TRUE)) character(0) > try(system("convert tmp/9vuec1369235838.ps tmp/9vuec1369235838.png",intern=TRUE)) character(0) > try(system("convert tmp/10qif41369235838.ps tmp/10qif41369235838.png",intern=TRUE)) character(0) > try(system("convert tmp/112e2m1369235838.ps tmp/112e2m1369235838.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 7.178 1.292 8.457