R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(106.9,107.5,116.1,102,111.2,111.8,91.2,93,105.4,111.6,104.6,91.6,98.3,97.7,106.3,102.3,106.6,108.1,93.8,88.2,108.9,114.2,102.5,94.2,97.4,98.5,106.5,102.9,97.1,103.7,93.4,85.8,108.6,110.2,101.2,101.2,96.9,99.4,118.7,108,101.2,119.9,94.8,95.3,118,115.9,111.4,108.2,108.8,109.5,124.8,115.3,109.5,124.2,92.9,98.4,120.9,111.7,116.1,109.4,111.7,114.3,133.7,114.3,126.5,131,104,108.9,128.5,132.4,128,116.4,120.9,118.6,133.1,121.1,127.6,135.4,114.9,114.3,128.9,138.9,129.4,115,128,127,128.8,137.9,128.4,135.9,122.2,113.1,136.2,138,115.2,111) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '0.0' > par1 = '36' > #'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: > 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 (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > 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/1vbxc1259866670.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2lk371259866670.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.00000000 0.38622219 0.41255918 0.52042171 0.18502267 0.28618940 [7] 0.26174289 0.02850670 0.11869786 0.14159540 -0.04877550 0.05535409 [13] 0.06952347 -0.06588009 0.09380145 0.06293978 -0.03756569 0.10230624 [19] 0.11654350 -0.03795079 0.14074933 0.11417410 -0.12496478 0.16721580 [25] -0.11542454 -0.10384243 0.06158107 -0.13994237 -0.06305912 -0.02687396 [31] -0.16049390 -0.07980033 -0.07288736 -0.21380501 -0.11506586 -0.11871284 [37] -0.22431665 > (mypacf <- c(rpacf$acf)) [1] 0.386222185 0.309569306 0.378068874 -0.189562665 0.033899984 [6] 0.022443630 -0.136348733 -0.045882995 0.127080888 -0.077011791 [11] -0.020138407 0.068451319 -0.020758750 0.058435644 0.041871986 [16] -0.032638269 0.002898847 0.131832036 -0.117588945 0.046986089 [21] 0.082822201 -0.238028235 0.116859801 -0.220717918 0.082089358 [26] -0.023047974 0.058265979 0.005008841 -0.078626934 -0.034698419 [31] 0.002683161 -0.086214619 -0.083883555 0.011556530 -0.068743437 [36] -0.011181326 > 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/3cfb11259866670.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/4708p1259866670.tab") > system("convert tmp/1vbxc1259866670.ps tmp/1vbxc1259866670.png") > system("convert tmp/2lk371259866670.ps tmp/2lk371259866670.png") > > > proc.time() user system elapsed 0.560 0.321 1.114