R version 2.9.0 (2009-04-17) 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(255.00 + ,280.20 + ,299.90 + ,339.20 + ,374.20 + ,393.50 + ,389.20 + ,381.70 + ,375.20 + ,369.00 + ,357.40 + ,352.10 + ,346.50 + ,342.90 + ,340.30 + ,328.30 + ,322.90 + ,314.30 + ,308.90 + ,294.00 + ,285.60 + ,281.20 + ,280.30 + ,278.80 + ,274.50 + ,270.40 + ,263.40 + ,259.90 + ,258.00 + ,262.70 + ,284.70 + ,311.30 + ,322.10 + ,327.00 + ,331.30 + ,333.30 + ,321.40 + ,327.00 + ,320.00 + ,314.70 + ,316.70 + ,314.40 + ,321.30 + ,318.20 + ,307.20 + ,301.30 + ,287.50 + ,277.70 + ,274.40 + ,258.80 + ,253.30 + ,251.00 + ,248.40 + ,249.50 + ,246.10 + ,244.50 + ,243.60 + ,244.00 + ,240.80 + ,249.80 + ,248.00 + ,259.40 + ,260.50 + ,260.80 + ,261.30 + ,259.50 + ,256.60 + ,257.90 + ,256.50 + ,254.20 + ,253.30 + ,253.80 + ,255.50 + ,257.10 + ,257.30 + ,253.20 + ,252.80 + ,252.00 + ,250.70 + ,252.20 + ,250.00 + ,251.00 + ,253.40 + ,251.20 + ,255.60 + ,261.10 + ,258.90 + ,259.90 + ,261.20 + ,264.70 + ,267.10 + ,266.40 + ,267.70 + ,268.60 + ,267.50 + ,268.50 + ,268.50 + ,270.50 + ,270.90 + ,270.10 + ,269.30 + ,269.80 + ,270.10 + ,264.90 + ,263.70 + ,264.80 + ,263.70 + ,255.90 + ,276.20 + ,360.10 + ,380.50 + ,373.70 + ,369.80 + ,366.60 + ,359.30 + ,345.80 + ,326.20 + ,324.50 + ,328.10 + ,327.50 + ,324.40 + ,316.50 + ,310.90 + ,301.50 + ,291.70 + ,290.40 + ,287.40 + ,277.70 + ,281.60 + ,288.00 + ,276.00 + ,272.90 + ,283.00 + ,283.30 + ,276.80 + ,284.50 + ,282.70 + ,281.20 + ,287.40 + ,283.10 + ,284.00 + ,285.50 + ,289.20 + ,292.50 + ,296.40 + ,305.20 + ,303.90 + ,311.50 + ,316.30 + ,316.70 + ,322.50 + ,317.10 + ,309.80 + ,303.80 + ,290.30 + ,293.70 + ,291.70 + ,296.50 + ,289.10 + ,288.50 + ,293.80 + ,297.70 + ,305.40 + ,302.70 + ,302.50 + ,303.00 + ,294.50 + ,294.10 + ,294.50 + ,297.10 + ,289.40 + ,292.40 + ,287.90 + ,286.60 + ,280.50 + ,272.40 + ,269.20 + ,270.60 + ,267.30 + ,262.50 + ,266.80 + ,268.80 + ,263.10 + ,261.20 + ,266.00 + ,262.50 + ,265.20 + ,261.30 + ,253.70 + ,249.20 + ,239.10 + ,236.40 + ,235.20 + ,245.20 + ,246.20 + ,247.70 + ,251.40 + ,253.30 + ,254.80 + ,250.00 + ,249.30 + ,241.50 + ,243.30 + ,248.00 + ,253.00 + ,252.90 + ,251.50 + ,251.60 + ,253.50 + ,259.80 + ,334.10 + ,448.00 + ,445.80 + ,445.00 + ,448.20 + ,438.20 + ,439.80 + ,423.40 + ,410.80 + ,408.40 + ,406.70 + ,405.90 + ,402.70 + ,405.10 + ,399.60 + ,386.50 + ,381.40 + ,375.20 + ,357.70 + ,359.00 + ,355.00 + ,352.70 + ,344.40 + ,343.80 + ,338.00 + ,339.00 + ,333.30 + ,334.40 + ,328.30 + ,330.70 + ,330.00 + ,331.60 + ,351.20 + ,389.40 + ,410.90 + ,442.80 + ,462.80 + ,466.90 + ,461.70 + ,439.20 + ,430.30 + ,416.10 + ,402.50 + ,397.30 + ,403.30 + ,395.90 + ,387.80 + ,378.60 + ,377.10 + ,370.40 + ,362.00 + ,350.30 + ,348.20 + ,344.60 + ,343.50 + ,342.80 + ,347.60 + ,346.60 + ,349.50 + ,342.10 + ,342.00 + ,342.80 + ,339.30 + ,348.20 + ,333.70 + ,334.70 + ,354.00 + ,367.70 + ,363.30 + ,358.40 + ,353.10 + ,343.10 + ,344.60 + ,344.40 + ,333.90 + ,331.70 + ,324.30 + ,321.20 + ,322.40 + ,321.70 + ,320.50 + ,312.80 + ,309.70 + ,315.60 + ,309.70 + ,304.60 + ,302.50 + ,301.50 + ,298.80 + ,291.30 + ,293.60 + ,294.60 + ,285.90 + ,297.60 + ,301.10 + ,293.80 + ,297.70 + ,292.90 + ,292.10 + ,287.20 + ,288.20 + ,283.80 + ,299.90 + ,292.40 + ,293.30 + ,300.80 + ,293.70 + ,293.10 + ,294.40 + ,292.10 + ,291.90 + ,282.50 + ,277.90 + ,287.50 + ,289.20 + ,285.60 + ,293.20 + ,290.80 + ,283.10 + ,275.00 + ,287.80 + ,287.80 + ,287.40 + ,284.00 + ,277.80 + ,277.60 + ,304.90 + ,294.00 + ,300.90 + ,324.00 + ,332.90 + ,341.60 + ,333.40 + ,348.20 + ,344.70 + ,344.70 + ,329.30 + ,323.50 + ,323.20 + ,317.40 + ,330.10 + ,329.20 + ,334.90 + ,315.80 + ,315.40 + ,319.60 + ,317.30 + ,313.80 + ,315.80 + ,311.30) > par2 = '12' > par1 = '500' > 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) + c(s.mean, s.median) + } > (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* 308.3508 0.2337822 7.951710 t2* 296.4500 2.7234000 9.774488 > z <- data.frame(cbind(r$t[,1],r$t[,2])) 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,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271 [... truncated] > colnames(z) <- list('mean','median') > postscript(file="/var/www/html/rcomp/tmp/1shbo1289482577.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > b <- boxplot(z,notch=TRUE,ylab='simulated values',main='Bootstrap Simulation - Central Tendency') > grid() > dev.off() null device 1 > b $stats [,1] [,2] [1,] 288.4472 277.8 [2,] 302.9386 292.4 [3,] 308.3893 297.6 [4,] 313.7267 303.9 [5,] 327.6411 320.5 $n [1] 500 500 $conf [,1] [,2] [1,] 307.6270 296.7874 [2,] 309.1516 298.4126 $out [1] 332.0786 330.6286 337.0519 331.1072 326.6000 332.1000 322.1000 323.2000 [9] 327.5000 324.5000 329.2500 267.7000 321.9000 270.4000 325.3500 323.2000 [17] 322.2500 321.3500 330.4000 $group [1] 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 $names [1] "mean" "median" > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/2z08i1289482577.tab") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'95% Confidence Intervals',3,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'',1,TRUE) > a<-table.element(a,'Mean',1,TRUE) > a<-table.element(a,'Median',1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Lower Bound',1,TRUE) > a<-table.element(a,b$conf[1,1]) > a<-table.element(a,b$conf[1,2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Upper Bound',1,TRUE) > a<-table.element(a,b$conf[2,1]) > a<-table.element(a,b$conf[2,2]) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/3ar7l1289482577.tab") > > try(system("convert tmp/1shbo1289482577.ps tmp/1shbo1289482577.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.058 0.193 1.169