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(104.1,90.2,99.2,116.5,98.4,90.6,130.5,107.4,106,196.5,107.8,90.5,123.8,114.7,115.3,197,88.4,93.8,111.3,105.9,123.6,171,97,99.2,126.6,103.4,121.3,129.6,110.8,98.9,122.8,120.9,133.1,203.1,110.2,119.5,135.1,113.9,137.4,157.1,126.4,112.2,128.8,136.8,156.5,215.2,146.7,130.8,133.1,153.4,159.9,174.6,145,112.9,137.8,150.6,162.1,226.4,112.3,126.3) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '0' > 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/19z2f1260613364.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/2stgf1260613364.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.046669060 0.198376166 0.083375606 -0.003059004 [6] 0.216419031 -0.012001000 -0.112422593 -0.025492261 -0.016847140 [11] -0.063472652 0.075433604 -0.442226993 -0.024136624 -0.155318432 [16] -0.074215760 0.022011357 -0.108203106 0.039186673 -0.139728011 [21] -0.026206373 0.008317400 -0.143861107 -0.085616611 -0.029825825 [26] -0.146877094 0.032031934 -0.051742504 -0.114455527 0.049673106 [31] -0.060770483 0.212618418 0.080608721 -0.026835738 0.115593257 [36] 0.061615687 0.079236195 0.150872478 -0.004893333 0.018612468 [41] 0.084016986 0.014450913 0.052960589 -0.137317343 -0.062620640 [46] -0.035355148 -0.031695202 -0.006883148 > (mypacf <- c(rpacf$acf)) [1] 0.0466690603 0.1966264170 0.0695981027 -0.0490053778 0.1971870453 [6] -0.0222591954 -0.2040350557 -0.0350844904 0.0717101836 -0.0963030282 [11] 0.0827183594 -0.4033105596 0.0029044105 -0.0355473122 0.0037423265 [16] 0.0062755360 0.1037578611 0.0362756093 -0.2717889553 -0.0572369467 [21] 0.1070664518 -0.2453872533 -0.0217635421 -0.0928674828 -0.1478799057 [26] -0.0914732948 0.0053858240 -0.1197490171 0.0337297861 0.1006894803 [31] 0.0690045332 -0.0380755654 -0.0004713303 -0.1451104582 -0.0023053906 [36] -0.0397969878 0.0130498503 -0.0766920668 -0.0312538257 -0.0613524478 [41] -0.0214015863 -0.0322139451 -0.0148326777 -0.0726052385 -0.0312446509 [46] -0.0463354146 -0.0696170922 > 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/32i821260613365.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/4vu9x1260613365.tab") > > system("convert tmp/19z2f1260613364.ps tmp/19z2f1260613364.png") > system("convert tmp/2stgf1260613364.ps tmp/2stgf1260613364.png") > > > proc.time() user system elapsed 0.589 0.317 0.909