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(0.9059,0.8883,0.8924,0.8833,0.87,0.8758,0.8858,0.917,0.9554,0.9922,0.9778,0.9808,0.9811,1.0014,1.0183,1.0622,1.0773,1.0807,1.0848,1.1582,1.1663,1.1372,1.1139,1.1222,1.1692,1.1702,1.2286,1.2613,1.2646,1.2262,1.1985,1.2007,1.2138,1.2266,1.2176,1.2218,1.249,1.2991,1.3408,1.3119,1.3014,1.3201,1.2938,1.2694,1.2165,1.2037,1.2292,1.2256,1.2015,1.1786,1.1856,1.2103,1.1938,1.202,1.2271,1.277,1.265,1.2684,1.2811,1.2727,1.2611,1.2881,1.3213,1.2999,1.3074,1.3242,1.3516,1.3511,1.3419,1.3716,1.3622,1.3896,1.4227,1.4684) > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1.8' > 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/1lcpf1228569288.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/2d5uk1228569288.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.251681971 -0.135432833 -0.134584672 0.112483842 [6] 0.015626709 -0.201509621 -0.011137550 0.021463608 0.041619744 [11] 0.040310548 0.090816182 -0.008275271 -0.046292734 0.030877352 [16] -0.080167053 -0.161828810 0.021816686 0.162508873 0.145095828 [21] -0.043512323 -0.085112295 -0.057257125 -0.073586110 -0.085008441 [26] -0.197137443 -0.091459908 0.026236423 0.030124935 -0.051717935 [31] -0.092985309 0.017741127 -0.079766496 -0.179132251 -0.049316383 [36] 0.057876558 0.027243552 -0.088727314 0.103728180 0.047281689 [41] -0.011756665 -0.031194267 0.049647150 -0.008622424 -0.147182611 [46] 0.036916332 0.146099309 0.142618014 0.008789791 0.018884956 [51] -0.018566587 -0.096349447 -0.030356737 0.060044148 0.050366003 [56] -0.011118464 0.019347520 0.040297356 0.054466844 0.006196220 [61] 0.007525329 > (mypacf <- c(rpacf$acf)) [1] 2.516820e-01 -2.122194e-01 -4.455495e-02 1.530032e-01 -1.051907e-01 [6] -1.733594e-01 1.476050e-01 -1.104172e-01 3.118169e-02 1.169851e-01 [11] 2.116908e-02 -8.151519e-02 6.157504e-02 1.642748e-02 -1.722713e-01 [16] -5.531942e-02 1.637761e-01 -9.286997e-03 1.091903e-01 1.184722e-02 [21] -1.441714e-01 -7.269075e-02 -1.482821e-02 -9.348715e-02 -1.903503e-01 [26] 5.640915e-02 1.206689e-02 -1.661825e-01 -2.127953e-06 -5.594288e-02 [31] -1.295385e-01 -1.102657e-01 -8.021787e-02 3.770834e-02 -2.351429e-02 [36] -2.971815e-02 -1.045463e-01 9.097326e-02 -9.984909e-02 6.432842e-03 [41] 3.428111e-02 5.043848e-02 -4.909283e-02 -2.942794e-02 4.165241e-02 [46] 2.648075e-02 1.077609e-01 2.976556e-04 -4.195888e-02 -3.850136e-02 [51] -6.230950e-02 -4.269577e-02 1.386428e-02 -1.316828e-03 -7.308656e-02 [56] -3.035520e-02 -9.896611e-02 -3.608482e-02 -5.655876e-02 -3.762658e-02 > 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/3sz0q1228569288.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/4nkm81228569288.tab") > > system("convert tmp/1lcpf1228569288.ps tmp/1lcpf1228569288.png") > system("convert tmp/2d5uk1228569288.ps tmp/2d5uk1228569288.png") > > > proc.time() user system elapsed 0.593 0.321 0.763