R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(1384.2,1368.9,-275.1,-408.9,-37.5,171.5,671.8,-18.5,231.6,747.5,1505.7,-83.6,1173.2,1452.1,777,-52.8,861.2,735.2,1073.6,966.9,1189.8,1093.5,1782.7,-70.4,1471.6,1273.8,900.8,-910.2,299.8,460.2,677.2,937.1,1265.4,1275.6,1582.6,-154.2,1667.6,1083.1,891.7,-26.5,423.4,662.8,711.4,993.3,1133.2,343.9,1415.8,-531.8,1193.6,1201.3,805.6,-164.8,327.3,223.7,675.8,949.7,704.4,265.6,1206,-558.2,1066.8,977.8,207.1,-980.7,-586.4,-24.3,-417.5,104.7,749.5,842.3,1176,-730.3,911.6,662.1,539.1,-236,286.9,497.4,912,519.4,260.1,945.2,412.7,-54.2,592.8,179.9,-548.6,-1685.8,-2041,-1048.7,-1708.4,-1550.7,-1650.2,-911.3) > 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: Write here your technical program description (don't use hard returns!) > 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 (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/1q16d1229964773.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x,par1,main='Autocorrelation',xlab='lags',ylab='ACF') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2w9891229964773.ps",horizontal=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.409844085 0.108505545 0.006198932 -0.072216461 [6] -0.029344738 0.066807067 -0.067543480 0.112913744 -0.096060523 [11] 0.107050805 -0.012095118 -0.253824150 0.050749125 -0.059173499 [16] 0.052748504 0.002078430 -0.050381426 0.101839631 -0.023338715 [21] 0.033338714 -0.070523751 0.043315310 -0.048661027 0.069275825 [26] -0.059047468 0.115980578 -0.070394170 -0.028067907 0.066678365 [31] 0.020100823 -0.171911170 0.103835321 -0.070180688 -0.034891979 [36] 0.116289087 -0.044109169 0.112565121 -0.131997861 0.084984395 [41] 0.030309320 -0.094052882 0.006024946 0.057755078 -0.045676960 [46] 0.107701676 -0.003899801 -0.075968992 -0.022585866 -0.062083932 [51] 0.071705848 -0.103631692 0.047519346 -0.012161510 -0.002915269 [56] 0.087035008 -0.085646047 0.020217312 -0.026286065 0.067328489 [61] -0.026043564 > (mypacf <- c(rpacf$acf)) [1] -4.098441e-01 -7.147192e-02 2.966416e-02 -6.167482e-02 -1.043314e-01 [6] 2.241839e-02 -2.469476e-02 8.451354e-02 -3.421320e-02 6.930677e-02 [11] 7.041313e-02 -2.817595e-01 -2.155125e-01 -1.349241e-01 2.957789e-02 [16] -1.916136e-02 -1.245420e-01 5.249458e-02 8.713190e-02 1.267210e-01 [21] -8.207530e-02 4.363967e-02 1.270946e-02 -4.849046e-02 -1.768719e-01 [26] -2.549397e-02 6.635473e-02 -1.177273e-01 -4.631156e-02 1.451813e-01 [31] -2.514163e-02 -2.707665e-02 -1.035530e-01 -7.443774e-02 9.775946e-02 [36] 2.476816e-03 7.433821e-02 -5.044534e-02 9.001074e-02 7.329929e-02 [41] -3.068740e-02 -5.665919e-02 -2.200522e-02 -2.771270e-02 -4.495466e-02 [46] 5.263239e-02 -1.237469e-02 -8.197850e-02 -4.081634e-02 3.339283e-02 [51] 8.796677e-05 -3.024845e-02 -5.189404e-02 -5.614421e-02 6.166566e-02 [56] -2.959058e-02 4.883992e-02 2.220129e-02 4.933955e-02 -3.749238e-03 > 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/3ou0v1229964773.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/4t1x61229964773.tab") > > system("convert tmp/1q16d1229964773.ps tmp/1q16d1229964773.png") > system("convert tmp/2w9891229964773.ps tmp/2w9891229964773.png") > > > proc.time() user system elapsed 0.611 0.306 0.728