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(106370,109375,116476,123297,114813,117925,126466,131235,120546,123791,129813,133463,122987,125418,130199,133016,121454,122044,128313,131556,120027,123001,130111,132524,123742,124931,133646,136557,127509,128945,137191,139716,129083,131604,139413,143125,133948,137116,144864,149277,138796,143258,150034,154708,144888,148762,156500,161088,152772,158011,163318,169969,162269,165765,170600,174681,166364,170240,176150,182056,172218,177856,182253,188090,176863,183273,187969,194650,183036,189516,193805,200499,188142,193732,197126,205140,191751,196700,199784,207360,196101,200824,205743,212489,200810,203683,207286,210910,194915,217920) > par7 = '0.95' > par6 = 'MA' > par5 = '4' > par4 = '1' > par3 = '1' > 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/1ncyd1260480478.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/20sv71260480478.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.149983863 -0.046210050 -0.007534017 -0.104641318 [6] -0.018494114 -0.051414501 0.055095663 -0.018638738 0.080871498 [11] 0.002929529 -0.047182110 -0.013686278 -0.039437223 0.033165882 [16] 0.027458174 -0.058068353 -0.016865160 0.003074195 -0.043772099 [21] -0.007775456 -0.015050834 0.041865003 0.037750666 0.049908612 [26] -0.049392937 -0.031797299 -0.089339751 0.061669216 -0.108320075 [31] 0.088386583 0.039749715 0.032636285 0.002709591 -0.100509599 [36] -0.015217970 -0.096860005 > (mypacf <- c(rpacf$acf)) [1] -0.14998386 -0.07028631 -0.02620989 -0.11649911 -0.05839380 -0.08219709 [7] 0.02304400 -0.03087215 0.06938931 0.01207728 -0.03124455 -0.02758674 [13] -0.03256478 0.02062607 0.03387201 -0.06306761 -0.04634282 -0.01762641 [19] -0.05315519 -0.02899960 -0.03942770 0.01960587 0.03079231 0.05363906 [25] -0.02971377 -0.02195802 -0.10245071 0.04840219 -0.12586863 0.05318590 [31] 0.01004311 0.04540914 -0.02158012 -0.07150305 -0.05110884 -0.09132284 > 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/37bcv1260480478.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/4h7by1260480478.tab") > system("convert tmp/1ncyd1260480478.ps tmp/1ncyd1260480478.png") > system("convert tmp/20sv71260480478.ps tmp/20sv71260480478.png") > > > proc.time() user system elapsed 0.548 0.318 0.679