R version 2.13.0 (2011-04-13) Copyright (C) 2011 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(61,81,87,87,136,147,168,185,137,125,64,45,35,-4,88,85,95,128,186,182,151,106,60,44,30,54,72,88,153,168,181,180,149,84,85,42,54,30,96,110,141,159,164,155,135,93,28,56,56,22,76,83,121,151,208,179,139,99,103,57,44,70,58,91,126,146,199,194,145,131,74,-3,7,10,34,94,105,151,162,175,128,115,62,11,-7,64,80,77,127,158,173,206,147,103,73,52,52,68,77,94,147,160,166,167,155,104,44,53,56,36,76,99,142,150,190,176,175,112,73,52,48,61,68,97,146,160,155,175,163,117,82,55,32,48,53,82,139,150,184,185,138,147,77,32,48,72,76,94,133,164,174,187,149,102,86,35,31,28,75,102,133,178,190,190,147,83,83,46,40,50,61,102,117,158,170,190,155,117,68,40,56,28,66,103,122,166,176,164,160,139,75,44,22,32,42,86,140,163,222,166,183,140,98,69,75,63,81,126,139,171,170,173,144,105,75,41,68,53,61,87,155,159,180,175,138,105,73,26,12,35,64,115,138,138,182,191,155,113,98,29) > par2 = '12' > par1 = '500' > #'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* 106.3708 -0.01703333 1.411216 t2* 102.0000 -0.41000000 1.840564 t3* 107.5000 -1.86800000 4.406747 > postscript(file="/var/wessaorg/rcomp/tmp/16zwi1321539458.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/wessaorg/rcomp/tmp/216xl1321539458.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/wessaorg/rcomp/tmp/34coq1321539458.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/wessaorg/rcomp/tmp/4v2o91321539458.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/wessaorg/rcomp/tmp/5q44c1321539458.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/wessaorg/rcomp/tmp/6j3sz1321539458.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/wessaorg/rcomp/tmp/7ckak1321539458.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(102.7, 105.370833333333, 106.4125, 107.233333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > grid() > dev.off() null device 1 > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/8gz8n1321539458.tab") > > try(system("convert tmp/16zwi1321539458.ps tmp/16zwi1321539458.png",intern=TRUE)) character(0) > try(system("convert tmp/216xl1321539458.ps tmp/216xl1321539458.png",intern=TRUE)) character(0) > try(system("convert tmp/34coq1321539458.ps tmp/34coq1321539458.png",intern=TRUE)) character(0) > try(system("convert tmp/4v2o91321539458.ps tmp/4v2o91321539458.png",intern=TRUE)) character(0) > try(system("convert tmp/5q44c1321539458.ps tmp/5q44c1321539458.png",intern=TRUE)) character(0) > try(system("convert tmp/6j3sz1321539458.ps tmp/6j3sz1321539458.png",intern=TRUE)) character(0) > try(system("convert tmp/7ckak1321539458.ps tmp/7ckak1321539458.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.142 0.356 3.544