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(313737,312276,309391,302950,300316,304035,333476,337698,335932,323931,313927,314485,313218,309664,302963,298989,298423,301631,329765,335083,327616,309119,295916,291413,291542,284678,276475,272566,264981,263290,296806,303598,286994,276427,266424,267153,268381,262522,255542,253158,243803,250741,280445,285257,270976,261076,255603,260376,263903,264291,263276,262572,256167,264221,293860,300713,287224,275902,271115,277509,279681) > 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: 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/html/rcomp/tmp/13hut1292332711.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/html/rcomp/tmp/23hut1292332711.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.0000000000 0.3358934086 -0.2948881615 -0.3971809413 -0.2310974758 [6] 0.0683923137 0.2028187683 0.0455099897 -0.2034198301 -0.3238531459 [11] -0.2207001359 0.3043158157 0.7756383701 0.2319803705 -0.2773909597 [16] -0.3408367709 -0.2062788750 0.0433715967 0.1560345472 0.0337666992 [21] -0.1768865139 -0.2669266211 -0.1582244581 0.2389309463 0.5525020124 [26] 0.1368766976 -0.2455661926 -0.2546555767 -0.1401245416 0.0543378325 [31] 0.1013488403 0.0180529040 -0.1339375127 -0.1736691016 -0.0721899906 [36] 0.1775266793 0.3280037955 0.0828553325 -0.1531802856 -0.1668050177 [41] -0.0840447912 0.0430183976 0.0654020125 0.0321696978 -0.0477152817 [46] -0.0725922815 -0.0267798580 0.0803573409 0.1580677524 0.0411213041 [51] -0.0816086871 -0.0867492854 -0.0318833941 0.0346559086 0.0278526058 [56] 0.0078761582 -0.0036504929 -0.0038239390 -0.0016890507 -0.0003289283 > (mypacf <- c(rpacf$acf)) [1] 0.335893409 -0.459562385 -0.140390092 -0.189601159 0.033417866 [6] -0.030983667 -0.117729723 -0.205042757 -0.273910774 -0.294301459 [11] 0.238991924 0.576736720 -0.238794711 0.186943356 0.077681286 [16] -0.041082039 -0.084212780 -0.029556532 -0.003238711 -0.113593908 [21] -0.030614970 -0.015590420 -0.160818843 -0.138750402 -0.065595757 [26] -0.104100386 -0.038422637 -0.017424535 0.026623688 -0.130516289 [31] 0.040901585 -0.002500690 0.050279703 0.022459102 -0.021834504 [36] -0.142635968 0.119995414 -0.013027083 -0.104461452 0.001566813 [41] -0.035400003 -0.026488312 -0.024313367 0.129752715 0.013057554 [46] -0.055244788 -0.010663792 0.055601264 -0.128015741 -0.006001333 [51] 0.028613620 -0.022692821 -0.038506514 0.030556475 -0.090068961 [56] -0.058910164 -0.005619516 -0.019805905 -0.059059770 > 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/3h99k1292332711.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/4a0rm1292332711.tab") > > try(system("convert tmp/13hut1292332711.ps tmp/13hut1292332711.png",intern=TRUE)) character(0) > try(system("convert tmp/23hut1292332711.ps tmp/23hut1292332711.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.616 0.321 1.319