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(217859,208679,213188,216234,213587,209465,204045,200237,203666,241476,260307,243324,244460,233575,237217,235243,230354,227184,221678,217142,219452,256446,265845,248624,241114,229245,231805,219277,219313,212610,214771,211142,211457,240048,240636,230580,208795,197922,194596,194581,185686,178106,172608,167302,168053,202300,202388,182516,173476,166444,171297,169701,164182,161914,159612,151001,158114,186530,187069,174330) > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '0.2' > 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/freestat/rcomp/tmp/1w08o1228471536.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/freestat/rcomp/tmp/2u2lt1228471536.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.0000000000 0.2156005655 -0.2794885230 -0.2431219580 -0.1269978758 [6] 0.0278333987 0.0363733961 0.0649754561 -0.1718988560 -0.2115412644 [11] -0.2089353089 0.2531449715 0.6991234903 0.1174443564 -0.2353852862 [16] -0.2038201112 -0.1176192739 -0.0006379771 0.0176578334 0.0173762725 [21] -0.1514150961 -0.1438876686 -0.1304636397 0.1967367990 0.4630663990 [26] 0.0502489693 -0.1911582396 -0.1770232780 -0.0796243918 0.0152788562 [31] 0.0200341533 -0.0007245591 -0.1105509586 -0.1048689124 -0.1291647194 [36] 0.1714508232 0.3735846971 0.0010246512 -0.1727978712 -0.1046947543 [41] -0.0333952266 0.0262797550 0.0400284739 0.0144190579 -0.0696101969 [46] -0.0584563172 -0.0485580207 0.1042468551 0.1805641812 -0.0096808366 [51] -0.0694600404 -0.0224926193 -0.0138226452 -0.0002055741 0.0333306310 [56] 0.0138660506 -0.0353873040 -0.0089942457 0.0121934564 > (mypacf <- c(rpacf$acf)) [1] 0.215600566 -0.341863158 -0.105166240 -0.155831885 -0.017660561 [6] -0.088760810 0.040114079 -0.281160223 -0.125947142 -0.372600465 [11] 0.282644675 0.497661776 -0.064699773 0.078096771 0.042882033 [16] -0.100618015 0.034769286 -0.152814233 -0.069274252 -0.008877979 [21] 0.014442802 -0.045285091 -0.081192266 -0.086459958 -0.037622666 [26] -0.091601596 -0.064726933 -0.032438108 0.017049930 -0.015867200 [31] 0.010103335 -0.030373705 -0.052480509 -0.153428287 0.027398900 [36] 0.015286017 -0.090713990 -0.014346095 0.056753134 -0.063921187 [41] 0.037929559 -0.052887678 0.003935324 0.015979517 0.073638673 [46] 0.118060014 -0.124715370 -0.193453238 0.100239908 -0.028368266 [51] 0.041741209 -0.010465289 -0.066963722 0.052196430 0.006632215 [56] -0.068294198 0.007135739 -0.003769818 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/37u7e1228471536.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/freestat/rcomp/tmp/4rr7q1228471536.tab") > > system("convert tmp/1w08o1228471536.ps tmp/1w08o1228471536.png") > system("convert tmp/2u2lt1228471536.ps tmp/2u2lt1228471536.png") > > > proc.time() user system elapsed 0.828 0.428 0.977