R version 2.7.0 (2008-04-22) 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 = '0' > 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/1bz8u1229275076.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/2xx9a1229275076.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.894636306 0.759818743 0.672017453 0.609930042 [6] 0.567002358 0.525084161 0.482585068 0.430183459 0.412420686 [11] 0.423374105 0.463251159 0.462658694 0.334622252 0.199164169 [16] 0.106438035 0.032109701 -0.021410589 -0.070951606 -0.119159180 [21] -0.165804848 -0.180073872 -0.177916142 -0.151610924 -0.153604317 [26] -0.227315787 -0.301284693 -0.339032843 -0.359284387 -0.365412406 [31] -0.371169280 -0.383009365 -0.390401557 -0.378023977 -0.345162716 [36] -0.291567157 -0.259753821 -0.284697961 -0.294162974 -0.277873889 [41] -0.268507642 -0.253573842 -0.238249078 -0.224210807 -0.209304204 [46] -0.178837972 -0.144381233 -0.104511389 -0.070647867 -0.065402437 [51] -0.044202741 -0.024468584 -0.026189434 -0.026910359 -0.024523359 [56] -0.023046075 -0.018994346 -0.008668883 -0.005055917 -0.006925925 > (mypacf <- c(rpacf$acf)) [1] 0.8946363061 -0.2031569135 0.1876270476 0.0049818333 0.0860587700 [6] -0.0233652923 0.0205376458 -0.0716685957 0.1938988295 0.0527831610 [11] 0.2237966166 -0.2180375304 -0.5362776081 0.0003566842 -0.0665267441 [16] -0.0879113257 0.0549218177 -0.0902454934 0.0415791343 0.0164416185 [21] -0.0620598892 -0.0959228308 0.0805397336 -0.0208980424 0.0772626897 [26] -0.0624801001 0.0491089992 0.0082196043 0.0151581533 -0.0710941118 [31] -0.0250670088 -0.0488446862 -0.0032653619 0.0548664673 0.0243502196 [36] -0.0051149718 -0.0710542147 0.1176341208 -0.0569334948 -0.1383680759 [41] 0.0122304416 -0.0228289812 0.1058535205 -0.0079545910 -0.0015687336 [46] -0.1249237855 -0.0047081573 0.0493403533 0.0616630263 -0.0320061195 [51] -0.0654261573 -0.0060793448 -0.0252263126 -0.0148597608 -0.0880231974 [56] 0.0115878535 -0.0351696063 0.0231256257 -0.1566929924 > 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/31h8e1229275076.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/4umqg1229275076.tab") > > system("convert tmp/1bz8u1229275076.ps tmp/1bz8u1229275076.png") > system("convert tmp/2xx9a1229275076.ps tmp/2xx9a1229275076.png") > > > proc.time() user system elapsed 1.546 0.550 1.644