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(11514,31514,27071,29462,26105,22397,23843,21705,18089,20764,25316,17704,15548,28029,29383,36438,32034,22679,24319,18004,17537,20366,22782,19169,13807,29743,25591,29096,26482,22405,27044,17970,18730,19684,19785,18479,10698,31956,29506,34506,27165,26736,23691,18157,17328,18205,20995,17382,9367,31124,26551,30651,25859,25100,25778,20418,18688,20424,24776,19814,12738,31566,30111,30019,31934,25826,26835,20205,17789,20520,22518,15572,11509,25447,24090,27786,26195,20516,22759,19028,16971,20036,22485,18730,14538,27561,25985,34670,32066,27186,29586,21359,21553,19573,24256,22380) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '48' > #'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/1qlx61292928602.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/2qlx61292928602.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.000000e+00 -3.920510e-01 1.001097e-01 -1.350826e-01 -5.933835e-02 [6] 2.310109e-02 3.363529e-02 -5.753419e-02 1.395989e-01 9.246754e-02 [11] -9.779318e-02 -3.048506e-02 -1.656080e-01 -8.435909e-02 8.117162e-02 [16] 1.082602e-01 -5.346001e-02 1.432234e-02 2.029623e-02 -1.074183e-01 [21] -1.678089e-02 1.243144e-01 -2.898331e-01 4.200853e-01 -2.307547e-01 [26] 1.467427e-01 -9.357762e-03 -2.700377e-02 -8.157922e-02 1.278663e-01 [31] -8.396279e-02 5.028905e-02 4.166762e-02 -1.111904e-01 1.212335e-01 [36] -2.660629e-02 -1.113982e-01 3.853858e-02 -4.578206e-02 -1.591309e-05 [41] 3.185501e-02 -4.241642e-02 1.595114e-02 1.693765e-02 7.972667e-02 [46] -1.654520e-01 1.497472e-01 -1.040337e-01 -8.646750e-03 > (mypacf <- c(rpacf$acf)) [1] -0.392050986 -0.063328010 -0.140202315 -0.193174284 -0.096621451 [6] -0.014562831 -0.101045527 0.075868535 0.239129440 0.049804814 [11] -0.030827598 -0.159268908 -0.290041290 -0.205416774 0.005163795 [16] -0.092008724 -0.148369493 0.028877315 -0.046372076 -0.089003002 [21] 0.283593617 -0.201873524 0.125524555 -0.066666533 -0.075402408 [26] 0.031473369 0.117822303 -0.069972199 0.013786543 0.056179638 [31] -0.047366301 -0.033255402 -0.025543367 -0.012475226 0.029943417 [36] -0.074301126 0.015465074 -0.099262612 -0.021869647 0.012997445 [41] -0.154809573 0.019361871 0.069910216 -0.003013457 0.079592768 [46] 0.075442596 0.066182140 -0.157747671 > 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/3mudf1292928602.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/4pdc31292928602.tab") > > try(system("convert tmp/1qlx61292928602.ps tmp/1qlx61292928602.png",intern=TRUE)) character(0) > try(system("convert tmp/2qlx61292928602.ps tmp/2qlx61292928602.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.60 0.45 1.03