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(4223.4,4627.3,5175.3,4550.7,4639.3,5498.7,5031.0,4033.3,4643.5,4873.2,4608.7,4733.5,3955.6,4590.9,5127.5,5257.3,5416.9,5813.3,5261.9,4669.2,5855.8,5274.6,5516.7,5819.5,5156.0,5377.3,6386.8,5144.0,6138.5,5567.8,5822.6,5145.5,5706.6,6078.5,6074.5,5577.6,5727.5,6067.0,7069.9,5490.0,5948.3,6177.5,6890.1,5756.2,6528.8,6792.0,6657.4,5753.7,5750.9,5968.4,5871.7,7004.9,6363.4,6694.7,7101.6,5364.0,6958.6,6503.3,5316.0,5312.7,4478.0) > 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/14i4k1262192390.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/21c3b1262192390.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.251757215 0.281763389 0.158031139 0.019317458 [6] 0.152338322 -0.042330021 -0.094670073 0.124302894 -0.002523713 [11] 0.193139260 0.003429234 -0.111054889 -0.084050614 -0.084148632 [16] -0.014035842 -0.174242893 -0.044852460 0.111711898 0.008528429 [21] 0.074302627 0.041783296 -0.035902858 0.108537230 -0.181039361 [26] -0.002423764 -0.012230029 -0.046034973 0.049028474 -0.016205343 [31] -0.121130532 0.020661587 -0.146225409 -0.112536407 -0.246175003 [36] -0.178933188 -0.090045239 -0.091242423 -0.114756493 -0.127847301 [41] -0.093406416 -0.021619697 -0.026287250 -0.016171900 -0.010367296 [46] 0.036244418 0.100641811 0.055946914 0.051024420 > (mypacf <- c(rpacf$acf)) [1] 0.251757215 0.233159754 0.050733781 -0.096252008 0.131472071 [6] -0.095264595 -0.144950837 0.212332217 0.023194751 0.122822290 [11] -0.097800213 -0.167417034 -0.125313311 0.060402873 0.087570389 [16] -0.189973598 0.119689746 0.177518490 -0.119601342 -0.062001467 [21] 0.172167409 -0.058495735 0.011571468 -0.169372849 0.032056789 [26] 0.089806938 0.003581353 -0.137708055 0.007771470 -0.047791348 [31] -0.008117769 -0.117043309 -0.095539405 -0.043307679 0.002824049 [36] -0.077540235 -0.047874091 0.002248915 -0.055518718 -0.100869967 [41] 0.014944880 0.181044591 -0.017290613 -0.027035603 0.068617009 [46] -0.035751676 0.025538383 0.002372261 > 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/3js4t1262192390.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/4xb1u1262192390.tab") > > try(system("convert tmp/14i4k1262192390.ps tmp/14i4k1262192390.png",intern=TRUE)) character(0) > try(system("convert tmp/21c3b1262192390.ps tmp/21c3b1262192390.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.598 0.327 1.847