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(113,95.4,86.2,111.7,97.5,99.7,111.5,91.8,86.3,88.7,95.1,105.1,104.5,89.1,82.6,102.7,91.8,94.1,103.1,93.2,91,94.3,99.4,115.7,116.8,99.8,96,115.9,109.1,117.3,109.8,112.8,110.7,100,113.3,122.4,112.5,104.2,92.5,117.2,109.3,106.1,118.8,105.3,106,102,112.9,116.5,114.8,100.5,85.4,114.6,109.9,100.7,115.5,100.7,99,102.3) > 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/rcomp/tmp/1y8em1292232252.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/2y8em1292232252.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.287272503 -0.320895260 0.155029627 -0.195800362 [6] 0.138973671 0.093186079 0.058779294 -0.022485437 -0.030256329 [11] -0.208299266 -0.144680055 0.592115501 -0.110136730 -0.253324329 [16] 0.030342660 -0.087775175 0.134250677 0.009837273 0.048987955 [21] 0.008772305 -0.083510423 -0.130976814 -0.064090337 0.350950377 [26] -0.017664468 -0.206399984 -0.034467821 0.016942666 0.057057459 [31] 0.005032504 0.094278375 -0.108016625 0.014888974 -0.041255360 [36] -0.159783144 0.347718772 -0.038888279 -0.205772343 0.096092385 [41] -0.053985452 0.007291937 0.072396982 0.038486244 -0.102526576 [46] 0.039585771 -0.013512896 -0.122071548 0.211805205 > (mypacf <- c(rpacf$acf)) [1] -0.287272503 -0.439707858 -0.140530641 -0.444158159 -0.163672254 [6] -0.210041028 0.156714781 0.133967000 0.413575315 -0.009763599 [11] -0.354671217 0.204628316 0.064679869 0.083618787 -0.267091979 [16] -0.033948146 -0.033928777 0.005696197 -0.049641480 -0.065247531 [21] -0.002843394 -0.035715331 0.012885363 -0.102918863 -0.041634996 [26] -0.113997996 -0.087513031 -0.007819381 -0.109956576 -0.009199609 [31] 0.072690901 -0.090571430 0.075130039 0.094081417 -0.018783636 [36] 0.055562121 -0.092010284 -0.080372483 0.047332918 -0.011894421 [41] -0.107563905 -0.073610846 -0.006925549 0.001062697 -0.029534661 [46] -0.051802360 0.033701283 -0.097107073 > 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/3j8vs1292232252.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/449ty1292232252.tab") > > try(system("convert tmp/1y8em1292232252.ps tmp/1y8em1292232252.png",intern=TRUE)) character(0) > try(system("convert tmp/2y8em1292232252.ps tmp/2y8em1292232252.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.650 0.390 1.054