R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(2953,2635,2404,2413,2136,1565,1451,2037,2477,2785,2994,2681,3098,2708,2517,2445,2087,1801,1216,2173,2286,3121,3458,3511,3524,2767,2744,2603,2527,1846,1066,2327,3066,3048,3806,4042,3583,3438,2957,2885,2744,1837,1447,2504,3248,3098,4318,3561,3316,3379,2717,2354,2445,1542,1606,2590,3588,3202,4704,4005,3810,3488,2781,2944,2817,1960,1937,2903,3357,3552,4581,3905,4581,4037,3345,3175,2808,2050,1719,3143,3756,4776,4540,4309,4563,3506,3665,3361,3094,2440,1633,2935,4159,4159,4894,4921,4577,4155,3851,3429,3370,2726) > 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* 3030.373 4.067451 146.30316 t2* 2975.500 33.490000 163.77045 t3* 2993.500 0.500000 91.32751 > postscript(file="/var/www/html/freestat/rcomp/tmp/1dta91272906014.ps",horizontal=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/www/html/freestat/rcomp/tmp/2dta91272906014.ps",horizontal=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/www/html/freestat/rcomp/tmp/3dta91272906014.ps",horizontal=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/www/html/freestat/rcomp/tmp/4olac1272906014.ps",horizontal=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/www/html/freestat/rcomp/tmp/5olac1272906014.ps",horizontal=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/www/html/freestat/rcomp/tmp/6olac1272906014.ps",horizontal=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/www/html/freestat/rcomp/tmp/7olac1272906014.ps",horizontal=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(2659.58823529412, 2933.27450980392, 3047.62254901961, : some notches went outside hinges ('box'): maybe set notch=FALSE > grid() > dev.off() null device 1 > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/www/html/freestat/rcomp/tmp/86esj1272906015.tab") > > try(system("convert tmp/1dta91272906014.ps tmp/1dta91272906014.png",intern=TRUE)) character(0) > try(system("convert tmp/2dta91272906014.ps tmp/2dta91272906014.png",intern=TRUE)) character(0) > try(system("convert tmp/3dta91272906014.ps tmp/3dta91272906014.png",intern=TRUE)) character(0) > try(system("convert tmp/4olac1272906014.ps tmp/4olac1272906014.png",intern=TRUE)) character(0) > try(system("convert tmp/5olac1272906014.ps tmp/5olac1272906014.png",intern=TRUE)) character(0) > try(system("convert tmp/6olac1272906014.ps tmp/6olac1272906014.png",intern=TRUE)) character(0) > try(system("convert tmp/7olac1272906014.ps tmp/7olac1272906014.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.532 1.605 2.880