R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(364,351,380,319,322,386,221,187,343,342,365,313,356,337,389,326,343,357,220,218,391,425,332,298,360,336,325,393,301,426,265,210,429,440,357,431,442,422,544,420,396,482,261,211,448,468,464,425,415,433,531,457,380,481,302,216,509,417,370) > par8 = '' > 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/rcomp/tmp/138dy1293494945.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/rcomp/tmp/2wicj1293494945.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.296524362 -0.022034705 0.264295138 0.086385345 [6] 0.075887136 0.193487296 0.019230570 0.062676346 0.132347392 [11] -0.084960331 0.197238826 0.596418513 0.122914052 -0.142527801 [16] 0.091988469 -0.004691948 -0.012593128 0.031065788 -0.084912376 [21] -0.075388991 -0.020284753 -0.207104926 -0.037830203 0.288983361 [26] -0.030067744 -0.217194732 -0.079134987 -0.138834657 -0.113165638 [31] -0.113357404 -0.190228285 -0.156720592 -0.118400494 -0.198326231 [36] -0.065132812 0.170895030 -0.034712561 -0.187420786 -0.076385247 [41] -0.081836700 -0.099860102 -0.071920954 -0.112719573 -0.103998374 [46] -0.068477071 -0.072602966 -0.041525957 0.074245524 > (mypacf <- c(rpacf$acf)) [1] 0.2965243622 -0.1205620227 0.3419679087 -0.1497928513 0.2107863499 [6] 0.0019174350 -0.0192717523 0.0801529717 -0.0094643117 -0.1185875105 [11] 0.3397828715 0.4461431265 -0.1741357979 -0.2284182989 -0.1053243070 [16] -0.0367879300 0.0000408035 -0.1216199770 0.0267168708 -0.1315952379 [21] 0.0592885044 -0.1806192789 -0.1039071189 0.0113053655 0.0321168003 [26] 0.0737367659 -0.1782500811 -0.0687142114 -0.0418385355 -0.0669199750 [31] 0.0199105253 -0.1061719305 0.0938159995 0.0762610197 0.1146522432 [36] -0.0326753879 -0.0715587610 0.0116524021 0.0674773145 0.0765197848 [41] -0.1165066679 0.0676604427 0.0237824117 0.0415462342 -0.0975487134 [46] -0.0015422131 -0.0918628899 -0.1041537514 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3z0t71293494945.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/rcomp/tmp/4s9sa1293494945.tab") > > try(system("convert tmp/138dy1293494945.ps tmp/138dy1293494945.png",intern=TRUE)) character(0) > try(system("convert tmp/2wicj1293494945.ps tmp/2wicj1293494945.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.660 0.400 1.048