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(31806,34571,37121,40438,43635,48064,50846,53668,58465,58618,55826,60412,62714,63332,66050,62948,59535,57298,56599,57686,57472,60463,60784,63154,64042,65460,65268,65774,66028,67104,68102,69897,72185,73538,72325,74820,74813,74533,76916,80371,81261,81557,81446,81995,79948) > par7 = '0.95' > par6 = 'White Noise' > par5 = '1' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '48' > #'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/19c4d1291728838.ps",horizontal=F,onefile=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/29c4d1291728838.ps",horizontal=F,onefile=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.379563749 -0.171433032 0.234812740 -0.129013210 [6] -0.169799367 0.140483081 0.030390722 0.016657329 -0.100238107 [11] 0.121007795 -0.075544883 0.032367201 -0.081919159 0.082848099 [16] -0.107505960 0.056168717 -0.043344553 0.109926397 -0.030445132 [21] -0.023669258 0.087888562 -0.042018153 -0.240474570 0.226567025 [26] -0.052499346 -0.129948870 0.177342524 0.010148203 -0.116052338 [31] 0.025172487 0.045527348 0.037087580 -0.094416984 0.036546901 [36] 0.056052026 -0.019784310 -0.018663074 0.020643479 -0.015670448 [41] 0.003213895 -0.009976689 0.001129081 > (mypacf <- c(rpacf$acf)) [1] -0.379563749 -0.368606276 0.007906966 -0.090867427 -0.251082489 [6] -0.151356265 -0.048116428 0.098297904 -0.113278888 0.013224081 [11] -0.061773958 0.101730055 -0.108910775 -0.001987973 -0.161463868 [16] -0.017305243 -0.141994469 0.042388321 0.011547374 -0.009006063 [21] 0.123332188 0.040559728 -0.195394894 -0.071067249 -0.043621600 [26] -0.181921269 -0.040906072 -0.123534849 -0.018582712 -0.148600090 [31] -0.011811201 0.049382435 0.047418290 -0.060863140 0.011100660 [36] 0.063811157 0.035436554 -0.078030478 -0.116654314 -0.004351439 [41] 0.013906449 -0.003241478 > 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/30ya81291728838.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/4gvjp1291728838.tab") > > try(system("convert tmp/19c4d1291728838.ps tmp/19c4d1291728838.png",intern=TRUE)) character(0) > try(system("convert tmp/29c4d1291728838.ps tmp/29c4d1291728838.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.592 0.316 1.245