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(13132.1,17665.9,16913,17318.8,16224.2,15469.6,16557.5,19414.8,17335,16525.2,18160.4,15553.8,15262.2,18581,17564.1,18948.6,17187.8,17564.8,17668.4,20811.7,17257.8,18984.2,20532.6,17082.3,16894.9,20274.9,20078.6,19900.9,17012.2,19642.9,19024,21691,18835.9,19873.4,21468.2,19406.8,18385.3,20739.3,22268.3,21569,17514.8,21124.7,21251,21393,22145.2,20310.5,23466.9,21264.6,18388.1,22635.4,22014.3,18422.7,16120.2,16037.7,16410.7,17749.8,16349.8,15662.3,17782.3,16398.9) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > 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/1ty0e1260449120.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/2wn5m1260449120.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.486217861 0.364636079 0.439543123 0.447739281 [6] 0.374015563 0.264477611 0.164812592 0.218936625 0.078955729 [11] -0.048898688 0.077357878 0.281389990 -0.043218491 -0.113920838 [16] -0.065712962 0.036979506 -0.043996535 -0.085443738 -0.090487106 [21] -0.067273444 -0.184823120 -0.203931453 -0.117490900 0.006513308 [26] -0.180137560 -0.278474614 -0.189834656 -0.093613562 -0.188863440 [31] -0.191140028 -0.176665140 -0.211468337 -0.248927321 -0.239592304 [36] -0.194667575 -0.103095951 > (mypacf <- c(rpacf$acf)) [1] 0.486217861 0.167927688 0.283499570 0.195754424 0.071839947 [6] -0.070869065 -0.161524743 0.018736741 -0.184139926 -0.170533001 [11] 0.147839350 0.448510794 -0.228902460 -0.163610665 -0.152052388 [16] 0.022157648 -0.138339469 0.127689709 0.148190746 -0.078567330 [21] -0.159134856 -0.001942346 -0.101141137 -0.033908730 0.106917386 [26] -0.018125762 -0.056296144 -0.055039698 -0.054279374 -0.114052449 [31] -0.001339546 -0.061685985 0.031929469 0.007008531 -0.040941808 [36] -0.086945498 > 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/30prn1260449120.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/4kq3d1260449120.tab") > > system("convert tmp/1ty0e1260449120.ps tmp/1ty0e1260449120.png") > system("convert tmp/2wn5m1260449120.ps tmp/2wn5m1260449120.png") > > > proc.time() user system elapsed 0.550 0.302 1.335