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(101.3,106.3,94,102.8,102,105.1,92.4,81.4,105.8,120.3,100.7,88.8,94.3,99.9,103.4,103.3,98.8,104.2,91.2,74.7,108.5,114.5,96.9,89.6,97.1,100.3,122.6,115.4,109,129.1,102.8,96.2,127.7,128.9,126.5,119.8,113.2,114.1,134.1,130,121.8,132.1,105.3,103,117.1,126.3,138.1,119.5,138,135.5,178.6,162.2,176.9,204.9,132.2,142.5,164.3,174.9,175.4,143) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '36' > ylab = '' > xlab = '' > main = '' > #'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/17ie91259775343.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/2mecy1259775343.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.755852413 0.607102726 0.584866646 0.544584290 [6] 0.579589372 0.521198656 0.425285517 0.315742829 0.227612777 [11] 0.138264620 0.210374105 0.293611676 0.162927378 0.092993420 [16] 0.076387747 0.081771789 0.141981345 0.146682645 0.101242873 [21] 0.061308956 0.008234883 -0.074166883 -0.001656619 0.051070357 [26] -0.052382261 -0.116963830 -0.173060265 -0.187937406 -0.157756718 [31] -0.168982464 -0.201384822 -0.213822817 -0.273577672 -0.330941391 [36] -0.258336529 -0.213708630 > (mypacf <- c(rpacf$acf)) [1] 0.7558524133 0.0834871236 0.2377106477 0.0513896511 0.2562981019 [6] -0.0969093792 -0.0566152045 -0.2202183693 -0.0973240565 -0.2440117263 [11] 0.3483481044 0.2195788772 -0.1310515182 -0.0012107062 0.0700611208 [16] -0.0385936244 -0.0210219136 -0.0016957754 -0.0825008148 -0.0734712526 [21] -0.0278894141 -0.1532581595 0.0834910094 0.0554054676 -0.0598417682 [26] -0.0454758702 -0.0002178054 -0.0531073013 -0.0770229224 -0.0264439512 [31] -0.0196809475 -0.0201775286 -0.0516545263 -0.0112495302 -0.0098559294 [36] 0.0035424279 > 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/3mxn21259775343.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/4ln0k1259775343.tab") > > system("convert tmp/17ie91259775343.ps tmp/17ie91259775343.png") > system("convert tmp/2mecy1259775343.ps tmp/2mecy1259775343.png") > > > proc.time() user system elapsed 0.539 0.309 0.898