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(22780,17351,21382,24561,17409,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) > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '-0.4' > 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/1g4z51228661958.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/2ky211228661958.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.000000e+00 2.031661e-01 3.172694e-01 8.270067e-02 8.396928e-02 [6] -9.360618e-04 7.932343e-02 -5.831963e-02 9.257792e-02 3.826511e-02 [11] -1.805056e-01 -1.586493e-01 -2.197835e-01 -1.614404e-01 1.312084e-02 [16] -1.111338e-02 -1.378099e-02 9.745781e-02 -1.293089e-03 -3.117532e-02 [21] -3.536276e-02 3.996353e-02 -6.183406e-02 1.455933e-01 -1.681574e-01 [26] 9.531517e-02 1.639029e-02 5.579003e-02 -9.379692e-02 6.530558e-02 [31] -1.137098e-01 -6.793125e-02 -1.661764e-01 -1.866527e-01 -9.241864e-02 [36] -7.985019e-02 -2.362241e-01 -7.166147e-02 -1.496962e-01 -4.316868e-02 [41] -6.768669e-02 -5.236363e-02 3.786117e-02 6.510004e-02 1.163081e-01 [46] 5.788644e-02 8.142537e-02 5.514430e-03 1.664620e-01 1.626616e-02 [51] 5.697681e-02 -4.755643e-02 6.982085e-02 -2.549402e-02 1.661005e-02 [56] -1.431844e-02 7.552640e-03 -1.136151e-02 -5.132068e-05 -1.522690e-03 > (mypacf <- c(rpacf$acf)) [1] 0.2031660840 0.2878754063 -0.0246661414 -0.0182512162 -0.0313403166 [6] 0.0755461756 -0.0779705115 0.0822431583 0.0570384031 -0.2832891666 [11] -0.1416916755 -0.0700756845 -0.0110783814 0.1649714156 0.0476786401 [16] -0.0521605625 0.0574618273 0.0118453995 -0.0407641027 -0.0437002815 [21] 0.0965668815 -0.1747678932 0.0404563969 -0.1802946952 0.1082528998 [26] 0.1523521059 0.0626188513 -0.1300537004 0.0220788606 -0.0660146295 [31] -0.1886404881 -0.1303512102 -0.0376897940 -0.0633812231 -0.0392520949 [36] -0.2123876663 0.0654856119 0.0654097317 0.1366844526 -0.0768303266 [41] -0.0547913247 0.0630485227 -0.1554376580 -0.0007145180 0.0959050812 [46] -0.1163689687 -0.0393542239 0.0533591601 0.0686805207 0.0175434365 [51] -0.0145472770 -0.0318977962 0.0043960020 0.0215355010 -0.0510465009 [56] -0.0973586908 0.0420917958 -0.0004920328 0.0857711971 > 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/3m42i1228661958.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/4p3z71228661958.tab") > > system("convert tmp/1g4z51228661958.ps tmp/1g4z51228661958.png") > system("convert tmp/2ky211228661958.ps tmp/2ky211228661958.png") > > > proc.time() user system elapsed 0.602 0.340 0.694