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(55,60,68,63,65,61,54,52,46,42,37,30,37,44,55,53,58,50,48,45,41,34,30,24,29,34,44,54,57,51,51,53,46,46,46,39,41,53,55,62,55,56,57,59,58,55,49,47,57,68,84,81,78,74,64,74,71,63,55,51,57,63,75,85,80,77,68,72,68,70,53,50,53,58,73,72,68,63,64,68,60,54,41,35,43,44,44,36,44,50,55,61,50,46,39,33,37,40,49,44,45,38,36,34,28,29,27,29,28,29,36,32,36,34,31,36,39,40,39,33,44,46,57,59,64,59,51,50,48,51,45,48,52,58,63,61,59,58,52,48,53,55,42,38,48,55,67,60,65,65,63,61,54,52,51,47,55,59,89,84,75,66,57,52,60,54,48,49,53,59,73,72,62,58,55,56,52,52,43,37,43,55,68,68,64,65,57,59,54,57,43,42,52,51,58,60,61,58,62,61,49,51,47,40,45,50,58,52,50,50,46,46,38,37,34,29,30,40,46,46,47,47,43,46,37,41,39,36,48,55,56,53,52,53,52,56,51,48,42,42,44,50,60,66,58,59,55,57,57,56,53,51,45,58,74,65,65,55,52,59,54,57,45,40,47,47,60,58,63,64,64,63,55,54,44) > par2 = '12' > 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) > par2 <- as.numeric(par2) > if (par1 < 10) par1 = 10 > if (par1 > 5000) par1 = 5000 > if (par2 < 3) par2 = 3 > if (par2 > length(x)) par2 = length(x) > library(lattice) > library(boot) Attaching package: 'boot' The following object(s) are masked from package:lattice : melanoma > boot.stat <- function(s) + { + s.mean <- mean(s) + s.median <- median(s) + s.midrange <- (max(s) + min(s)) / 2 + c(s.mean, s.median, s.midrange) + } > (r <- tsboot(x, boot.stat, R=par1, l=12, sim='fixed')) BLOCK BOOTSTRAP FOR TIME SERIES Fixed Block Length of 12 Call: tsboot(tseries = x, statistic = boot.stat, R = par1, l = 12, sim = "fixed") Bootstrap Statistics : original bias std. error t1* 52.28727 -0.3708364 1.960545 t2* 53.00000 -0.6600000 2.026458 t3* 56.50000 -0.0800000 1.310709 > postscript(file="/var/yougetitorg/rcomp/tmp/11cln1304360009.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/2dvd41304360009.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/35vps1304360009.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/48qyn1304360009.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/5r6zw1304360009.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/6n9av1304360009.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])) Warning message: In data.row.names(row.names, rowsi, i) : some row.names duplicated: 2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50 --> row.names NOT used > colnames(z) <- list('mean','median','midrange') > postscript(file="/var/yougetitorg/rcomp/tmp/7nqi61304360009.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(47.7781818181818, 50.7345454545455, 52.0872727272727, : 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 Blocked 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/8i4gm1304360009.tab") > > try(system("convert tmp/11cln1304360009.ps tmp/11cln1304360009.png",intern=TRUE)) character(0) > try(system("convert tmp/2dvd41304360009.ps tmp/2dvd41304360009.png",intern=TRUE)) character(0) > try(system("convert tmp/35vps1304360009.ps tmp/35vps1304360009.png",intern=TRUE)) character(0) > try(system("convert tmp/48qyn1304360009.ps tmp/48qyn1304360009.png",intern=TRUE)) character(0) > try(system("convert tmp/5r6zw1304360009.ps tmp/5r6zw1304360009.png",intern=TRUE)) character(0) > try(system("convert tmp/6n9av1304360009.ps tmp/6n9av1304360009.png",intern=TRUE)) character(0) > try(system("convert tmp/7nqi61304360009.ps tmp/7nqi61304360009.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.010 1.200 2.581