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(244,243,242,240,260,259,244,234,235,235,236,238,240,233,233,233,247,251,233,226,233,233,227,225,223,212,206,202,223,221,212,205,204,200,195,193,196,180,174,164,192,189,181,167,166,164,167,164,161,141,134,111,147,144,142,140,143,137,140,130,129,112,101,74,104,103,100,98,99,91,92,94,93,76,64,32,62,69,69,68,68,59,66,73,70,57,48,22,64,74,67,61,61,52,54,69,69,53,50,22,69,78,74,63,67,59,60,80,77,58,54,32,78,86,84,78,72,64,62,72) > 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/1b0ng1281903883.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/2g6xv1281903883.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.969917444 0.943060601 0.920493150 0.908809392 [6] 0.894321265 0.880514870 0.860233440 0.839289031 0.813212813 [11] 0.798137935 0.786854879 0.781427322 0.746759233 0.714666560 [16] 0.685790156 0.665851143 0.641636634 0.618844008 0.592068924 [21] 0.563131402 0.528157188 0.503323819 0.483371315 0.470077466 [26] 0.433259892 0.398744798 0.367191925 0.344336428 0.316733632 [31] 0.292178865 0.263924964 0.233065965 0.197121839 0.170372254 [36] 0.148891958 0.133793065 0.099482369 0.068887941 0.039916691 [41] 0.020466074 -0.004960792 -0.027958895 -0.054044962 -0.081770666 [46] -0.114230176 -0.137975446 -0.157093224 -0.168595519 > (mypacf <- c(rpacf$acf)) [1] 0.969917444 0.039162105 0.061508880 0.180775159 -0.026591389 [6] 0.029139937 -0.087795074 -0.042907187 -0.111505331 0.129279770 [11] 0.062476305 0.104099056 -0.444567445 0.020089972 0.014800373 [16] 0.008854834 -0.069941747 -0.018053332 0.001951788 -0.065206974 [21] -0.046972186 0.022900797 0.038076638 0.031531643 -0.191613487 [26] 0.008761175 0.008433735 0.012861431 -0.065391047 0.003890222 [31] -0.030722096 -0.048437815 -0.002130148 -0.006451716 0.019892739 [36] -0.001938185 -0.086258594 0.035918997 -0.022529045 0.036569601 [41] -0.074611665 -0.033897068 -0.035479072 -0.017320728 -0.010731457 [46] -0.011329979 -0.001028811 0.032802808 > 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/326dj1281903883.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/4n7uo1281903883.tab") > > try(system("convert tmp/1b0ng1281903883.ps tmp/1b0ng1281903883.png",intern=TRUE)) character(0) > try(system("convert tmp/2g6xv1281903883.ps tmp/2g6xv1281903883.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.578 0.311 0.951