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(131676 + ,135050 + ,129070 + ,137792 + ,139762 + ,142917 + ,144198 + ,142648 + ,152170 + ,136022 + ,138142 + ,138135 + ,135027 + ,132911 + ,133976 + ,137012 + ,119610 + ,118106 + ,120383 + ,133185 + ,131416 + ,134248 + ,134397 + ,127728 + ,131837 + ,125955 + ,134187 + ,143291 + ,145074 + ,149812 + ,144668 + ,147253 + ,145568 + ,155564 + ,155872 + ,156323 + ,158010 + ,155598 + ,154785 + ,157294 + ,162938 + ,157283 + ,166074 + ,169282 + ,172552 + ,174055 + ,175409 + ,173696 + ,171283 + ,173322 + ,170717 + ,174229 + ,175339 + ,173511 + ,175839 + ,173816 + ,173990 + ,174777 + ,174819 + ,176726 + ,176199 + ,180952 + ,176663 + ,182346 + ,180605 + ,182497 + ,187856 + ,190020 + ,190108 + ,193288 + ,193230 + ,199068 + ,195076 + ,191563 + ,191067 + ,186665 + ,185508 + ,184371 + ,183046 + ,175714 + ,175768 + ,171029 + ,170465 + ,170102 + ,156389 + ,124291 + ,99360 + ,86675 + ,85056 + ,128236 + ,164257 + ,162401 + ,152779 + ,156005 + ,153387 + ,153190 + ,148840 + ,144211 + ,145953 + ,145542 + ,150271 + ,147489 + ,143824 + ,134754 + ,131736 + ,126304 + ,125511 + ,125495 + ,130133 + ,126257 + ,110323 + ,98417 + ,105749 + ,120665 + ,124075 + ,127245 + ,146731 + ,144979 + ,148210 + ,144670 + ,142970 + ,142524 + ,146142 + ,146522 + ,148128 + ,148798 + ,150181 + ,152388 + ,155694 + ,160662 + ,155520 + ,158262 + ,154338 + ,158196 + ,160371 + ,154856 + ,150636 + ,145899 + ,141242 + ,140834 + ,141119 + ,139104 + ,134437 + ,129425 + ,123155 + ,119273 + ,120472 + ,121523 + ,121983 + ,123658 + ,124794 + ,124827 + ,120382 + ,117395 + ,115790 + ,114283 + ,117271 + ,117448 + ,118764 + ,120550 + ,123554 + ,125412 + ,124182 + ,119828 + ,115361 + ,114226 + ,115214 + ,115864 + ,114276 + ,113469 + ,114883 + ,114172 + ,111225 + ,112149 + ,115618 + ,118002 + ,121382 + ,120663) > 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* 145214.8 -862.5397 5863.351 t2* 144439.5 -1348.1300 6637.968 t3* 142062.0 -240.7400 6276.866 > postscript(file="/var/yougetitorg/rcomp/tmp/1t4bn1304457835.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/2yqbx1304457835.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/3g03m1304457835.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/4omo01304457835.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/5l9c21304457835.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/6lcw61304457835.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/77ko01304457835.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(130264.466292135, 140443.044943820, 144364.508426966, : 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/8on4l1304457835.tab") > > try(system("convert tmp/1t4bn1304457835.ps tmp/1t4bn1304457835.png",intern=TRUE)) character(0) > try(system("convert tmp/2yqbx1304457835.ps tmp/2yqbx1304457835.png",intern=TRUE)) character(0) > try(system("convert tmp/3g03m1304457835.ps tmp/3g03m1304457835.png",intern=TRUE)) character(0) > try(system("convert tmp/4omo01304457835.ps tmp/4omo01304457835.png",intern=TRUE)) character(0) > try(system("convert tmp/5l9c21304457835.ps tmp/5l9c21304457835.png",intern=TRUE)) character(0) > try(system("convert tmp/6lcw61304457835.ps tmp/6lcw61304457835.png",intern=TRUE)) character(0) > try(system("convert tmp/77ko01304457835.ps tmp/77ko01304457835.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.010 1.250 2.775