R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(2291180,1971664,2193270,2197733,2345324,2195121,2170583,2241521,2154945,2912568,2392562,3336621,4080642,3735329,4018383,4171360,3855698,4101316,4199346,3959646,3960841,4784025,4105467,5929558,4048642,3828808,4268127,4171816,4004783,4295447,3968177,3918480,4040260,4530715,4103330,6025506,4632308,4133863,4519182,4151573,4486595,4504699,4180443,4222193,4373727,4734738,4403232,5903985,4414074,4061816,4504697,3994176,4114925,4485120,4171230,4476075,4179369,4823185,4585751,6110454,4279575,3782118,4098678,4065616,4413733,4481214,4345018,4294488,4361269,4535031,4318397,6040168) > par5 = '12' > par4 = '0' > 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: 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/1ckft1242196887.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/2n6ic1242196887.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.463380601 0.062846583 0.059889135 -0.146237042 [6] -0.012261193 0.154153014 -0.072672934 -0.080775592 0.109886235 [11] -0.033926704 -0.369510480 0.692130160 -0.437462050 0.149689260 [16] 0.015626683 -0.172398648 0.041530431 0.096793222 -0.045414387 [21] -0.047910725 0.060588438 -0.053255450 -0.198002784 0.509841450 [26] -0.353296300 0.121005984 -0.002431634 -0.118657381 0.042015661 [31] 0.033303420 -0.042603249 0.023920166 0.012900382 -0.049811440 [36] -0.146423165 0.348098632 -0.237594250 0.125173951 -0.050708109 [41] -0.075558244 0.048419457 0.007135134 -0.019239733 0.001848810 [46] 0.027083772 -0.025452858 -0.073319079 0.128190787 > (mypacf <- c(rpacf$acf)) [1] -0.463380601 -0.193402741 0.006646595 -0.129905261 -0.183129285 [6] 0.069489731 0.071718539 -0.124566960 -0.028067794 0.069724339 [11] -0.478240282 0.458892216 0.005724545 -0.003305717 -0.063366726 [16] -0.073204747 -0.008374623 -0.084993681 0.052383685 -0.013230700 [21] -0.157098039 -0.067235115 0.102359119 0.107718098 0.078507541 [26] -0.135329427 -0.039924321 0.065754266 -0.044713477 -0.063967143 [31] -0.106383157 0.049741961 -0.057115835 -0.014571452 -0.001234872 [36] -0.063814687 -0.025009594 0.047991157 -0.019721748 -0.022867917 [41] -0.041746598 -0.046172076 0.020452745 -0.106370989 0.065382299 [46] -0.026757505 0.029404885 -0.239751059 > 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/3nu0s1242196887.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/4s2t01242196887.tab") > > system("convert tmp/1ckft1242196887.ps tmp/1ckft1242196887.png") > system("convert tmp/2n6ic1242196887.ps tmp/2n6ic1242196887.png") > > > proc.time() user system elapsed 0.556 0.310 1.110