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.7,101.9,102,102.2,102.4,102.6,102.6,102.5,102.5,102.6,102.7,102.9,103.1,103.2,103.2,103,102.8,102.6,102.4,102.2,101.9,101.6,101.3,101.2,111.7,111.4,111.1,111.1,111.3,111.9,112.4,112.9,113,113,112.7,112.4,112.3,112.5,112.8,113.2,114,114.9,115.6,115.5,115,114.9,115.2,115.4,115,114.6,114.5,114.4,113.9,113.2,112.7,112.6,112.5,112.3,112,111.7,119.2) > 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/1mdc31229684233.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/2w6wy1229684233.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.0287713848 -0.0579603165 -0.0439679384 -0.0268191044 [6] 0.0033880121 -0.0269988816 -0.0398836005 -0.0530615965 -0.0366683236 [11] -0.0444530053 -0.0588041092 -0.0465962470 -0.0029480966 0.0013064910 [16] -0.0107779297 -0.0100774616 0.0085377573 0.0394209022 0.0096603289 [21] -0.0221929498 -0.0160444886 -0.0009287105 -0.0043092664 -0.0489524046 [26] -0.0568961518 -0.0350051779 -0.0190344228 -0.0384010604 -0.0335151816 [31] -0.0207108239 0.0104059484 -0.0061223644 -0.0214328321 -0.0425044530 [36] -0.0436978584 0.4586603703 0.0031510708 -0.0076856800 -0.0106437182 [41] -0.0123689988 -0.0077763970 -0.0078911396 -0.0095766538 -0.0113615840 [46] -0.0122716540 -0.0036576778 -0.0002978336 0.0026096682 0.0019332256 [51] -0.0023967524 -0.0025462905 -0.0079847562 -0.0141241042 -0.0109630918 [56] -0.0025181227 -0.0026726316 -0.0029414689 -0.0079176505 -0.0039414274 > (mypacf <- c(rpacf$acf)) [1] -0.028771385 -0.058836814 -0.047630648 -0.033364867 -0.004102326 [6] -0.033024155 -0.045188296 -0.061409719 -0.049915687 -0.062372221 [11] -0.079428465 -0.072083721 -0.032441289 -0.029028379 -0.038480787 [16] -0.036866373 -0.019819292 0.009776384 -0.016115183 -0.044137063 [21] -0.039332135 -0.028475660 -0.033315293 -0.075041877 -0.085141096 [26] -0.072635983 -0.065760470 -0.089695999 -0.088273668 -0.085238071 [31] -0.066559478 -0.091477120 -0.113116814 -0.152093984 -0.188101209 [36] 0.358342887 -0.043787136 -0.018107901 -0.025581131 -0.039641346 [41] -0.066408736 -0.042838009 -0.035912011 -0.022633544 -0.033837731 [46] -0.010754390 0.013158504 0.015548270 -0.018391477 -0.025666284 [51] -0.016912003 -0.027546734 -0.050416319 -0.080366732 -0.052468458 [56] -0.024034181 -0.027738856 -0.044837064 -0.039066154 > 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/3r6s01229684233.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/440k31229684233.tab") > > system("convert tmp/1mdc31229684233.ps tmp/1mdc31229684233.png") > system("convert tmp/2w6wy1229684233.ps tmp/2w6wy1229684233.png") > > > proc.time() user system elapsed 0.610 0.323 0.949