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(76,75,74,72,70,69,70,72,73,73,74,76,74,67,66,58,55,58,64,68,66,76,75,88,85,83,77,66,65,65,63,62,57,68,69,79,74,76,82,75,75,76,78,77,67,74,68,87,76,88,95,96,96,105,108,113,101,107,102,116,105,121,134,140,131,141,131,128,123,129,125,144,135,141,156,159,146,154,145,133,126,127,122,148) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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/1gkzm1282292452.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/2gkzm1282292452.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.93015801 0.85102994 0.74344686 0.64302307 0.54255939 [7] 0.46936760 0.40132454 0.34761047 0.31409054 0.28792073 0.26815559 [13] 0.26616290 0.26691284 0.25804536 0.23286781 0.18514034 0.12662102 [19] 0.07589591 0.02828119 -0.02096766 -0.07108040 -0.13152529 -0.19006195 [25] -0.23764024 -0.27883120 -0.29777407 -0.29323719 -0.26654242 -0.23634521 [31] -0.20432477 -0.18497665 -0.17448959 -0.17466947 -0.19229394 -0.22340084 [37] -0.25384332 -0.28715855 -0.32007652 -0.33857530 -0.33962949 -0.34075828 [43] -0.32128525 -0.29594705 -0.25719408 -0.22756412 -0.20422956 -0.18869960 [49] -0.18398924 > (mypacf <- c(rpacf$acf)) [1] 0.9301580101 -0.1050693521 -0.2519275343 0.0151647331 -0.0263282423 [6] 0.1242503948 -0.0332714680 -0.0165334308 0.1180536227 -0.0149914748 [11] -0.0049423457 0.1199377149 0.0009067884 -0.0938091916 -0.1261876121 [16] -0.1448915654 -0.0025597871 0.0942154055 -0.0264078049 -0.0980737494 [21] -0.1021153406 -0.1616239171 -0.0171312788 0.0508122252 -0.0551597712 [26] 0.0780394557 0.0639522750 0.0731155994 0.0285517940 -0.0203758016 [31] -0.0581784241 -0.0471101601 -0.0866702547 -0.1165529473 -0.0128766749 [36] 0.0819861725 0.0043501455 -0.0614399498 0.0026897881 0.0505926851 [41] -0.1372139983 -0.0085777344 0.0115260825 0.1089947974 -0.0572799804 [46] -0.1299929379 0.0280408065 -0.0502418405 > 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/3e09l1282292452.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/4h0p91282292452.tab") > > try(system("convert tmp/1gkzm1282292452.ps tmp/1gkzm1282292452.png",intern=TRUE)) character(0) > try(system("convert tmp/2gkzm1282292452.ps tmp/2gkzm1282292452.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.588 0.318 2.176