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(118,117,116,114,112,111,112,114,115,115,116,118,126,131,122,124,119,112,109,108,117,122,127,124,129,141,127,133,114,98,93,101,111,128,126,134,140,158,144,146,138,119,113,120,127,141,144,150,156,174,163,167,160,141,132,144,155,164,162,181,187,209,189,201,193,177,159,158,155,164,163,185,191,217,193,192,184,166,145,146,138,149,145,166) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/1gmy91281887808.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/2gmy91281887808.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.00000000 0.91661025 0.83006470 0.69987194 0.59548569 0.49176182 [7] 0.45120305 0.43556672 0.47810549 0.52362607 0.60022296 0.62917674 [13] 0.66313712 0.59201641 0.51234205 0.39951289 0.29684620 0.19247496 [19] 0.13324476 0.09178408 0.09585393 0.10970894 0.16130937 0.18783457 [25] 0.21996817 0.17734380 0.12688399 0.04530566 -0.03835470 -0.13074270 [31] -0.18902418 -0.23012734 -0.23611169 -0.22748867 -0.18374930 -0.16045656 [37] -0.12313354 -0.13477433 -0.15283553 -0.19814566 -0.25012208 -0.30925920 [43] -0.34915876 -0.37370148 -0.37397815 -0.36699026 -0.32934381 -0.30774432 [49] -0.27316623 > (mypacf <- c(rpacf$acf)) [1] 0.916610252 -0.063254238 -0.321140456 0.102868591 0.005628287 [6] 0.280050405 0.136041786 0.219808724 0.051580189 0.172675857 [11] -0.137893534 0.118519653 -0.487813030 -0.043316174 0.070567942 [16] -0.144426325 -0.008897896 -0.106354395 -0.072121828 -0.065934033 [21] 0.029606677 0.040419056 0.098423881 -0.029149770 -0.154992720 [26] 0.076787918 -0.041442285 -0.029873430 -0.019104238 -0.013797305 [31] 0.034175694 -0.072022176 -0.010696724 -0.027067206 -0.078024723 [36] 0.058841652 0.027686968 -0.002443171 -0.013805745 -0.028426493 [41] 0.030413912 -0.012341546 0.044322108 -0.015824875 -0.061483280 [46] -0.042280264 -0.036609861 -0.020958736 > 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/3uweh1281887808.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/4yxv51281887808.tab") > > try(system("convert tmp/1gmy91281887808.ps tmp/1gmy91281887808.png",intern=TRUE)) character(0) > try(system("convert tmp/2gmy91281887808.ps tmp/2gmy91281887808.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.550 0.315 0.763