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(130.7,117.2,110.8,111.4,108.2,108.8,110.2,109.5,109.5,116,111.2,112.1,114,119.1,114.1,115.1,115.4,110.8,116,119.2,126.5,127.8,131.3,140.3,137.3,143,134.5,139.9,159.3,170.4,175,175.8,180.9,180.3,169.6,172.3,184.8,177.7,184.6,211.4,215.3,215.9,244.7,259.3,289,310.9,321,315.1,333.2,314.1,284.7,273.9,216,196.4,190.9,206.4,196.3,199.5,198.9,214.4) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '2' > 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: > 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/1hng21260299590.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/2flay1260299590.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.4331830168 -0.0256330493 0.1347315321 -0.0075813047 [6] -0.1773554477 0.1663813200 0.0138495051 -0.3037451752 0.2493101999 [11] -0.1687423090 0.0116146291 0.0901975771 -0.0586899530 -0.1507585891 [16] 0.1419696564 0.0649015936 -0.0250108916 -0.0483930141 0.0687919899 [21] 0.0120709290 -0.0048488554 -0.0980624451 0.1098475179 -0.0736859403 [26] -0.0556059158 0.1403989758 -0.0363213207 0.0085955593 -0.1005938778 [31] 0.0766889594 -0.0382397676 -0.0079007911 0.0720892727 -0.1047609585 [36] 0.0639675928 0.0235426300 0.0014323384 -0.0503152826 0.0519119502 [41] -0.0025658272 -0.0579967134 0.1024748729 -0.0661161004 -0.0113043146 [46] -0.0121924561 0.0339274659 -0.0684870256 0.0405098024 -0.0336996981 [51] -0.0005854702 0.0138907785 0.0256529216 -0.0075591394 -0.0014590897 [56] -0.0008063592 0.0055810754 0.0078694539 > (mypacf <- c(rpacf$acf)) [1] -0.433183017 -0.262546840 0.009230610 0.083534931 -0.149272435 [6] 0.003986979 0.081280448 -0.278705736 -0.031641671 -0.199949805 [11] -0.068332057 0.055747569 -0.090015944 -0.193226703 -0.118316033 [16] 0.013667746 0.185151978 -0.144380317 -0.062973878 0.084742712 [21] 0.047098504 -0.216507999 -0.090536931 -0.031478683 0.003692903 [26] 0.067305666 0.028857824 0.073438977 -0.114745167 -0.067181600 [31] 0.030703625 -0.202489678 0.071802133 0.035514682 -0.027683843 [36] 0.013377354 -0.020887161 0.031649679 -0.046917552 -0.024952061 [41] 0.127048315 0.007460803 -0.126937075 -0.024450109 -0.034681281 [46] -0.031924965 -0.074348688 0.017950926 -0.005044243 0.003652740 [51] -0.070489926 -0.027023078 -0.096568165 -0.046556830 0.058037847 [56] -0.076394812 -0.076145228 > 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/3pbhd1260299590.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/44m091260299590.tab") > > system("convert tmp/1hng21260299590.ps tmp/1hng21260299590.png") > system("convert tmp/2flay1260299590.ps tmp/2flay1260299590.png") > > > proc.time() user system elapsed 0.581 0.296 2.959