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(239,238,237,235,233,232,233,235,236,236,237,239,238,237,244,230,237,244,239,240,230,228,231,228,225,227,238,214,222,233,228,218,203,209,207,203,195,199,207,182,181,189,186,174,153,158,153,147,143,156,168,142,146,150,145,133,111,115,109,105,96,112,127,107,116,125,120,107,86,87,79,83,75,89,104,86,98,98,85,74,49,54,47,56) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > 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/170ya1281079703.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/270ya1281079703.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.0000000000 -0.1412084420 -0.2085054830 0.0546731725 0.1029525548 [6] 0.0720192015 -0.5732445289 0.0908931875 0.1146984745 0.0868337214 [11] -0.2027402012 -0.1097469303 0.7805679051 -0.1475934183 -0.1979772145 [16] 0.0000687455 0.1278258596 0.0559181658 -0.4688906731 0.0959622512 [21] 0.0626594368 0.0813367644 -0.1908531222 -0.0897154452 0.5584957146 [26] -0.1538106576 -0.1105098219 -0.0215676108 0.0845457936 0.0457443069 [31] -0.3308343686 0.0744724887 0.0011636976 0.0872980762 -0.1549838825 [36] -0.0523464396 0.3663244042 -0.1446369711 -0.0508642166 -0.0254492182 [41] 0.0424821732 0.0399034187 -0.1583567427 0.0677858677 -0.0469088537 [46] 0.0798221047 -0.0889374900 -0.0352905241 0.2152613419 > (mypacf <- c(rpacf$acf)) [1] -0.141208442 -0.233093143 -0.015695950 0.066140876 0.120077150 [6] -0.553632420 -0.064563430 -0.150449597 0.231570709 -0.227630028 [11] -0.053785164 0.605187396 0.023768370 -0.019191813 -0.047579812 [16] 0.030910747 -0.004965896 0.163314224 -0.002212533 -0.155555424 [21] -0.112728484 0.008477480 0.006185633 -0.129938752 -0.100381507 [26] 0.076261384 0.019662356 -0.151793197 -0.038867649 0.066460110 [31] -0.042747729 -0.025532681 0.033402814 -0.050234567 0.002146929 [36] -0.018307600 -0.003176668 -0.132018883 0.003567234 0.003481835 [41] 0.047888837 0.063625769 0.037900397 -0.019336259 -0.035801845 [46] 0.065760266 0.028639174 0.030537763 > 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/3siwy1281079703.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/4djvm1281079703.tab") > > try(system("convert tmp/170ya1281079703.ps tmp/170ya1281079703.png",intern=TRUE)) character(0) > try(system("convert tmp/270ya1281079703.ps tmp/270ya1281079703.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.565 0.323 0.724