R version 2.12.0 (2010-10-15) Copyright (C) 2010 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(12008,9169,8788,8417,8247,8197,8236,8253,7733,8366,8626,8863,10102,8463,9114,8563,8872,8301,8301,8278,7736,7973,8268,9476,11100,8962,9173,8738,8459,8078,8411,8291,7810,8616,8312,9692,9911,8915,9452,9112,8472,8230,8384,8625,8221,8649,8625,10443,10357,8586,8892,8329,8101,7922,8120,7838,7735,8406,8209,9451,10041,9411,10405,8467,8464,8102,7627,7513,7510,8291,8064,9383) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '60' > #'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: > 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 (par2 == 0) { + x <- log(x) + } else { + x <- (x ^ par2 - 1) / par2 + } > if (par3 > 0) x <- diff(x,lag=1,difference=par3) > if (par4 > 0) x <- diff(x,lag=par5,difference=par4) > postscript(file="/var/www/rcomp/tmp/1nt3n1293191082.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=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/2nt3n1293191082.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') > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.000000000 -0.057067353 -0.150961911 -0.175894991 0.069776089 [6] -0.098313904 -0.016096184 -0.078043288 0.092275208 0.109994490 [11] 0.162902843 -0.104317370 -0.309945477 -0.064056928 0.186104771 [16] 0.129750180 -0.114015817 0.062713556 -0.057601188 0.137158992 [21] -0.120851492 0.006155112 -0.172282805 0.181167889 0.169050163 [26] -0.050760502 -0.271227239 0.099220934 -0.035467322 0.057130013 [31] 0.075093229 0.009078817 -0.001701721 -0.021183216 0.023892919 [36] -0.116826453 -0.164744673 0.047408244 0.183592204 -0.008768060 [41] -0.068325877 -0.021861493 -0.014532394 -0.055220020 0.007499695 [46] -0.021029176 0.047313736 0.059160433 0.151562608 -0.023022273 [51] -0.110381689 0.010940005 -0.060316911 -0.038454751 0.009663303 [56] 0.011682042 0.001288902 -0.001550384 0.003246486 > (mypacf <- c(rpacf$acf)) [1] -0.0570673530 -0.1547224757 -0.2000987540 0.0171025943 -0.1604497455 [6] -0.0656049201 -0.1248257539 0.0076916580 0.0860238871 0.1694708940 [11] -0.0126293852 -0.2840210744 -0.1049579986 0.0759812004 0.1263341344 [16] -0.0590601206 0.0579501643 -0.1585226553 0.0876032751 -0.0353046864 [21] 0.1138343908 -0.0799148717 0.0603840679 0.0921866860 -0.1291924651 [26] -0.1124878023 0.1063639691 -0.1024250724 0.0132067877 0.1743600523 [31] -0.0113018704 0.0147812098 -0.0906336614 -0.0215417748 0.0026023726 [36] -0.0945132356 0.0199133662 -0.1050236034 -0.0003242703 -0.1041140581 [41] 0.0023457187 -0.0380056074 0.0084719371 -0.0760520405 -0.0102116200 [46] -0.0064951233 0.0037635990 0.0801571580 0.0861715613 0.0489022732 [51] 0.0053814502 -0.0824241239 -0.0863075890 -0.0590393870 0.0358067413 [56] -0.0170061291 -0.0636441511 -0.0711836505 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3jljw1293191082.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/rcomp/tmp/4uc0h1293191082.tab") > > try(system("convert tmp/1nt3n1293191082.ps tmp/1nt3n1293191082.png",intern=TRUE)) character(0) > try(system("convert tmp/2nt3n1293191082.ps tmp/2nt3n1293191082.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.730 0.340 1.102