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(25.64,27.97,27.62,23.31,29.07,29.58,28.63,29.92,32.68,31.54,32.43,26.54,25.85,27.60,25.71,25.38,28.57,27.64,25.36,25.90,26.29,21.74,19.20,19.32,19.82,20.36,24.31,25.97,25.61,24.67,25.59,26.09,28.37,27.34,24.46,27.46,30.23,32.33,29.87,24.87,25.48,27.28,28.24,29.58,26.95,29.08,28.76,29.59,30.70,30.52,32.67,33.19,37.13,35.54,37.75,41.84,42.94,49.14,44.61,40.22,44.23,45.85,53.38,53.26,51.80,55.30,57.81,63.96,63.77,59.15,56.12,57.42,63.52,61.71,63.01,68.18,72.03,69.75,74.41,74.33,64.24,60.03,59.44,62.50,55.04,58.34,61.92,67.65,67.68,70.30,75.26,71.44,76.36,81.71,92.60,90.60,92.23,94.09,102.79,109.65,124.05,132.69,135.81,116.07,101.42,75.73,55.48,43.80,45.29,44.01,47.48,51.07,57.84,69.04,65.61,72.87,68.41,73.25,77.43,75.28,77.33,74.31,79.70,85.47,77.98,75.69,75.20,77.21,77.85,83.53,85.99) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '60' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2009, 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: > #Technical description: > if (par1 == 'Default') { + par1 = 10*log10(length(x)) + } else { + par1 <- as.numeric(par1) + } > par2 <- as.numeric(par2) > par3 <- as.numeric(par3) > par4 <- as.numeric(par4) > par5 <- as.numeric(par5) > if (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > if (par8 != '') par8 <- as.numeric(par8) > ox <- x > if (par8 == '') { + if (par2 == 0) { + x <- log(x) + } else { + x <- (x ^ par2 - 1) / par2 + } + } else { + x <- log(x,base=par8) + } > if (par3 > 0) x <- diff(x,lag=1,difference=par3) > if (par4 > 0) x <- diff(x,lag=par5,difference=par4) > postscript(file="/var/www/html/rcomp/tmp/1yqd01292847831.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > op <- par(mfrow=c(2,1)) > plot(ox,type='l',main='Original Time Series',xlab='time',ylab='value') > if (par8=='') { + mytitle <- paste('Working Time Series (lambda=',par2,', d=',par3,', D=',par4,')',sep='') + mysub <- paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='') + } else { + mytitle <- paste('Working Time Series (base=',par8,', d=',par3,', D=',par4,')',sep='') + mysub <- paste('(base=',par8,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='') + } > plot(x,type='l', main=mytitle,xlab='time',ylab='value') > par(op) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/28zc31292847831.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=mysub) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/38zc31292847831.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > rpacf <- pacf(x,par1,main='Partial Autocorrelation',xlab='lags',ylab='PACF',sub=mysub) > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.0000000000 0.4520208351 0.2946970614 0.0462117948 -0.0687227104 [6] -0.1952251717 -0.2742389265 -0.1885523311 -0.1779567789 -0.1748620136 [11] -0.0496844748 0.0133617998 -0.0634794834 -0.1085925527 -0.0423230408 [16] 0.0340161569 -0.0632146330 -0.0898248256 -0.0527795435 0.0277496329 [21] -0.0248002010 0.0989946810 0.0823252821 0.0739199317 0.0009400813 [26] 0.1069715942 0.0718216222 -0.0045163629 -0.0122549355 -0.0406945012 [31] -0.0042051538 -0.0906803865 -0.0382030265 -0.0130825842 -0.0057884887 [36] 0.0670668802 0.0684329987 0.0651596008 -0.0376657075 -0.0334215233 [41] 0.0035719854 -0.0265046950 -0.0363943139 -0.0744191806 -0.0037714589 [46] 0.0135592820 0.0351666531 0.0487935078 -0.0012905583 -0.0877735500 [51] -0.0206747541 -0.0018558155 -0.0207897168 -0.0230567227 -0.1018504330 [56] -0.0024971454 0.0187618881 -0.0009050509 0.0352061716 -0.0123067181 [61] -0.0022199495 > (mypacf <- c(rpacf$acf)) [1] 4.520208e-01 1.135815e-01 -1.568711e-01 -9.026230e-02 -1.321714e-01 [6] -1.481033e-01 3.968884e-02 -6.358074e-02 -1.340288e-01 6.675715e-02 [11] 8.228223e-03 -2.032005e-01 -1.179651e-01 4.376509e-02 4.559472e-02 [16] -1.658271e-01 -1.347482e-01 -3.085648e-02 7.200149e-02 -1.044406e-01 [21] 4.955707e-02 -6.071811e-02 -2.813297e-02 -5.057999e-02 8.854848e-02 [26] -6.274484e-02 -4.284838e-02 4.901925e-02 -1.012767e-01 -5.505096e-03 [31] -4.276489e-02 6.479218e-03 -3.345888e-05 6.671394e-03 9.013593e-02 [36] -5.493928e-02 -1.860937e-02 -5.551595e-02 5.383610e-02 9.093018e-04 [41] -7.527467e-03 -1.100056e-02 -7.441535e-02 3.918555e-02 7.121635e-02 [46] -1.959066e-02 -3.223843e-02 -1.885239e-02 -1.287508e-01 8.367134e-02 [51] 1.805303e-02 -4.704195e-02 1.323320e-02 -1.715951e-01 3.167995e-02 [56] 6.519702e-02 -8.469800e-02 -2.408828e-02 7.933967e-04 -1.059795e-01 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #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,'Autocorrelation Function',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Time lag k',header=TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/basics.htm','ACF(k)','click here for more information about the Autocorrelation Function'),header=TRUE) > a<-table.element(a,'T-STAT',header=TRUE) > a<-table.element(a,'P-value',header=TRUE) > a<-table.row.end(a) > for (i in 2:(par1+1)) { + a<-table.row.start(a) + a<-table.element(a,i-1,header=TRUE) + a<-table.element(a,round(myacf[i],6)) + mytstat <- myacf[i]*sqrtn + a<-table.element(a,round(mytstat,4)) + a<-table.element(a,round(1-pt(abs(mytstat),lengthx),6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/44rsc1292847831.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Partial Autocorrelation Function',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Time lag k',header=TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/basics.htm','PACF(k)','click here for more information about the Partial Autocorrelation Function'),header=TRUE) > a<-table.element(a,'T-STAT',header=TRUE) > a<-table.element(a,'P-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:par1) { + a<-table.row.start(a) + a<-table.element(a,i,header=TRUE) + a<-table.element(a,round(mypacf[i],6)) + mytstat <- mypacf[i]*sqrtn + a<-table.element(a,round(mytstat,4)) + a<-table.element(a,round(1-pt(abs(mytstat),lengthx),6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/5x09x1292847831.tab") > > try(system("convert tmp/1yqd01292847831.ps tmp/1yqd01292847831.png",intern=TRUE)) character(0) > try(system("convert tmp/28zc31292847831.ps tmp/28zc31292847831.png",intern=TRUE)) character(0) > try(system("convert tmp/38zc31292847831.ps tmp/38zc31292847831.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.771 0.487 1.918