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(111078,150739,159129,157928,147768,137507,136919,136151,133001,125554,119647,114158,116193,152803,161761,160942,149470,139208,134588,130322,126611,122401,117352,112135,112879,148729,157230,157221,146681,136524,132111,125326,122716,116615,113719,110737,112093,143565,149946,149147,134339,122683,115614,116566,111272,104609,101802,94542,93051,124129,130374,123946,114971,105531,104919,104782,101281,94545,93248,84031,87486) > par5 = '12' > par4 = '0' > 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/115391229272314.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/2rj491229272314.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.3082193037 -0.0782605041 -0.3037537407 -0.2704301980 [6] -0.0605691332 -0.0027592840 -0.0775076008 -0.2649806739 -0.2647103317 [11] -0.0894922519 0.2855745497 0.7779212141 0.2542948735 -0.0547048346 [16] -0.2485180762 -0.2203925569 -0.0566866833 -0.0278807358 -0.0527800271 [21] -0.1938063228 -0.1799719343 -0.0706979007 0.2049280997 0.5795098280 [26] 0.1794516988 -0.0521720433 -0.1996870234 -0.1523879135 -0.0382364599 [31] -0.0001210202 -0.0318039867 -0.1450817052 -0.1186183498 -0.0677220141 [36] 0.1394224537 0.3795711888 0.1146852755 -0.0481675880 -0.1377536974 [41] -0.1020924773 -0.0173831828 0.0329164047 -0.0196829185 -0.0913250403 [46] -0.0733457138 -0.0659850040 0.0659280873 0.1914116890 0.0433344774 [51] -0.0313610698 -0.0471104972 -0.0331443114 0.0079854522 0.0099000156 [56] -0.0156107383 -0.0347828856 -0.0138929892 -0.0380155589 0.0183323667 > (mypacf <- c(rpacf$acf)) [1] 0.3082193037 -0.1914469375 -0.2477622090 -0.1280547381 0.0076943894 [6] -0.1125553078 -0.1911213333 -0.3280874301 -0.2797082093 -0.2491936901 [11] 0.0195420168 0.6304684980 -0.1759372938 0.0213393595 0.1074837264 [16] 0.0024963975 -0.0702188641 -0.0560482769 0.1081695813 0.0762375727 [21] 0.0626882012 0.0399906128 -0.0914579513 0.0180536537 -0.0704640209 [26] -0.0725981282 -0.0077944567 0.0636274898 0.0207730537 0.0879284911 [31] -0.0134620687 -0.0193204314 0.0037737953 -0.0362660723 -0.0312103417 [36] -0.1315406342 0.0511844934 0.0148273912 0.0033548216 -0.0363783751 [41] -0.0163527749 0.0374849385 -0.0788752427 -0.0014188336 0.0009425976 [46] -0.0104091129 -0.0323878870 -0.1317816521 -0.0455071525 -0.0035909422 [51] 0.0522724638 -0.0130776338 -0.0055397929 -0.1133330100 0.0173427748 [56] 0.0012197968 -0.0113270136 0.0181809700 0.0521606966 > 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/350581229272314.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/4xk4d1229272314.tab") > > system("convert tmp/115391229272314.ps tmp/115391229272314.png") > system("convert tmp/2rj491229272314.ps tmp/2rj491229272314.png") > > > proc.time() user system elapsed 1.546 0.559 1.652