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(97.57,97.74,97.92,98.19,98.23,98.41,98.59,98.71,99.14,99.62,100.18,100.66,101.19,101.75,102.2,102.87,98.81,97.6,96.68,95.96,98.89,99.05,99.2,99.11,99.19,99.77,100.70,100.78,100.53,101.01,100.92,101.10,103.11,102.99,102.31,102.61,103.68,104.72,107.66,108.87,108.12,107.61,106.42,105.61,105.71,105.49,105.57,105.18,106.09,106.34,108.47,116.87,121.08,123.27,124.18,125.60,126.57,127.18,128.04,128.55,129.67) > par5 = '12' > par4 = '0' > par3 = '2' > par2 = '-2.0' > 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/1x3b01229700514.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/23k611229700514.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.000000e+00 -2.926766e-01 -1.218051e-01 1.028530e-01 -3.340991e-01 [6] 1.099027e-01 7.489373e-02 6.587483e-02 -1.302839e-01 9.527518e-03 [11] -4.767878e-02 -1.309670e-01 2.344650e-01 5.458918e-03 -2.854588e-02 [16] 4.437891e-02 -8.914777e-02 -3.345314e-02 7.361644e-02 1.168292e-01 [21] -1.171420e-01 8.978798e-03 -1.044162e-01 -1.014637e-02 8.216804e-02 [26] -8.994644e-03 8.967937e-02 -5.806316e-02 -7.637084e-03 -2.996648e-02 [31] -7.648482e-02 2.905276e-01 -1.452921e-01 4.226545e-02 -1.284776e-02 [36] -2.428139e-01 1.189414e-01 1.158593e-02 5.115968e-02 -3.275654e-02 [41] 1.454090e-02 1.502131e-02 -4.791253e-03 2.721579e-02 -2.961657e-02 [46] 3.036918e-03 2.991449e-04 -1.198632e-02 9.044769e-03 -1.274807e-03 [51] 1.369592e-03 -2.016158e-03 1.407277e-03 2.261067e-04 -6.716070e-04 [56] 8.554766e-04 -7.766785e-04 2.178872e-04 1.009346e-05 > (mypacf <- c(rpacf$acf)) [1] -0.292676554 -0.226900950 -0.008410387 -0.377577202 -0.144335073 [6] -0.091944415 0.094827887 -0.235145986 -0.090072338 -0.174706487 [11] -0.231821182 -0.099371164 -0.053758419 -0.086735102 -0.088888014 [16] -0.078324067 -0.114131949 -0.063774554 0.067396087 -0.059571641 [21] -0.041986379 -0.184063411 -0.012161230 -0.105229157 -0.101258611 [26] -0.059001994 -0.037637850 -0.050585867 -0.068865629 -0.199558269 [31] 0.186271475 -0.048558027 0.126188438 0.014812503 -0.002666638 [36] -0.058618838 0.028169270 -0.041989371 -0.065159411 -0.062188714 [41] 0.078140210 0.111781721 -0.061872505 -0.047412422 -0.050439881 [46] -0.081383204 -0.041902256 -0.013683000 -0.022723042 -0.109973901 [51] 0.003960756 -0.059165164 0.066748665 -0.073731362 0.016335158 [56] -0.066456885 -0.064420696 -0.039971290 > 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/3oory1229700514.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/42dgg1229700514.tab") > > system("convert tmp/1x3b01229700514.ps tmp/1x3b01229700514.png") > system("convert tmp/23k611229700514.ps tmp/23k611229700514.png") > > > proc.time() user system elapsed 0.596 0.334 0.712