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(20.98,20.1,20.61,20.27,20.08,23.58,22.31,22.89,21.78,22.19,22.58,22.78,25.06,25.16,25.47,25.34,24.2,25.32,25.57,25.76,24.79,23.14,22.66,22.06,24.26,23.15,22.92,21.43,21.56,23.48,24.35,24.83,24.19,23.58,23.58,24.35,27.18,25.69,24.81,23.26,23.49,26.86,27.12,27.66,26.26,25.51,24.63,23.57,27.63,25.85,26.09,24.47,24.19,25.09,25.26,25.58,24.76,25.02,24.24,24.14,28.69,26.74,26.48,24.45,23.88,26.58,26.23,28.63,26.81,26.56,26.64,26.8,28.37,27.13,28.44,28.62,27.28,31.32,31.26,31.41,31.76,32.72,32.15,33.62,35.97,33.78,33.77,32.75,32.55,33.22,32.88,31.56,30.27,28.65,27.89,27.07,30.8,28.38,27.5,28,28.02,29.2,27.59,27.22,27.16,26.31,25.67,26.41,28.34,25.43,23.72,23.33,23.8,27.7,26.28,27.51,27.93,28.76,28.65,29.52,31.23,27.9,27.87,27.52,27.59,31.2,30.22,30.62,31.52,30.59,31.42,31.95) > 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* 26.67053 -0.1962985 0.8289402 t2* 26.44500 -0.2914000 0.9665318 t3* 28.02500 -0.4459000 0.9718280 > postscript(file="/var/wessaorg/rcomp/tmp/15hi91321963228.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/2csbr1321963228.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/3f6nu1321963228.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/4i4pi1321963228.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/5kmwm1321963228.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/6a5cu1321963228.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/7nbcc1321963228.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(24.3894696969697, 25.9931060606061, 26.4254924242424, : 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/829q81321963228.tab") > > try(system("convert tmp/15hi91321963228.ps tmp/15hi91321963228.png",intern=TRUE)) character(0) > try(system("convert tmp/2csbr1321963228.ps tmp/2csbr1321963228.png",intern=TRUE)) character(0) > try(system("convert tmp/3f6nu1321963228.ps tmp/3f6nu1321963228.png",intern=TRUE)) character(0) > try(system("convert tmp/4i4pi1321963228.ps tmp/4i4pi1321963228.png",intern=TRUE)) character(0) > try(system("convert tmp/5kmwm1321963228.ps tmp/5kmwm1321963228.png",intern=TRUE)) character(0) > try(system("convert tmp/6a5cu1321963228.ps tmp/6a5cu1321963228.png",intern=TRUE)) character(0) > try(system("convert tmp/7nbcc1321963228.ps tmp/7nbcc1321963228.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.079 0.379 2.475