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(101.02,100.67,100.47,100.38,100.33,100.34,100.37,100.39,100.21,100.21,100.22,100.28,100.25,100.25,100.21,100.16,100.18,100.1,99.96,99.88,99.88,99.86,99.84,99.8,99.82,99.81,99.92,100.03,99.99,100.02,100.01,100.13,100.33,100.13,99.96,100.05,99.83,99.8,100.01,100.1,100.13,100.16,100.41,101.34,101.65,101.85,102.07,102.12,102.14,102.21,102.28,102.19,102.33,102.54,102.44,102.78,102.9,103.08,102.77,102.65,102.71,103.29,102.86,103.45,103.72,103.65,103.83,104.45,105.14,105.07,105.31,105.19,105.3,105.02,105.17,105.28,105.45,105.38,105.8,105.96,105.08,105.11,105.61,105.5) > par5 = '12' > par4 = '0' > par3 = '0' > 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/12b5j1229423610.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/2h5l31229423610.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.973075694 0.942380608 0.916205823 0.887427334 [6] 0.846379394 0.807554548 0.772052011 0.733318954 0.694733791 [11] 0.657458325 0.622168658 0.580140537 0.538621580 0.495995438 [16] 0.453862729 0.407735003 0.369825033 0.337623208 0.302958419 [21] 0.268041812 0.235712235 0.206384896 0.170576456 0.139294287 [26] 0.107389994 0.072423537 0.033124236 -0.003250086 -0.037878248 [31] -0.070559254 -0.103324794 -0.133162973 -0.162363942 -0.193596732 [36] -0.223704385 -0.253386447 -0.283992236 -0.312580770 -0.337901822 [41] -0.362085043 -0.383077386 -0.393713175 -0.399034372 -0.401517633 [46] -0.403322824 -0.402474659 -0.398795847 -0.395797400 > (mypacf <- c(rpacf$acf)) [1] 0.9730756940 -0.0846269874 0.0747589104 -0.0761529677 -0.2341309341 [6] 0.0460250091 0.0007661843 -0.0636716354 0.0439234894 -0.0380647395 [11] 0.0075194544 -0.1360596611 -0.0124725884 -0.0758086411 -0.0138422521 [16] -0.0646858881 0.1377062164 0.0598357210 -0.0588149141 -0.0060769545 [21] -0.0630338623 -0.0113984282 -0.1104407031 0.0693799719 -0.0656406407 [26] -0.0797539558 -0.0509584103 -0.0540129571 -0.0148667721 0.0370427538 [31] -0.0421905694 0.0174097305 -0.0525273913 -0.0352629281 -0.0438918479 [36] -0.0456651869 -0.0655127661 0.0706752241 -0.0283545863 0.0100127182 [41] 0.0444066155 0.1204091207 0.0123506236 0.0380184680 -0.0282234349 [46] -0.0364700749 0.0345057015 -0.0357971856 > 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/3fnsy1229423610.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/41n9b1229423610.tab") > > system("convert tmp/12b5j1229423610.ps tmp/12b5j1229423610.png") > system("convert tmp/2h5l31229423610.ps tmp/2h5l31229423610.png") > > > proc.time() user system elapsed 0.569 0.331 0.822