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(356,386,444,387,327,448,225,182,460,411,342,361,377,331,428,340,352,461,221,198,422,329,320,375,364,351,380,319,322,386,221,187,344,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,442,544,420,396,482,261,211,448,468,464,425) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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/1qiza1292318260.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/html/rcomp/tmp/2qiza1292318260.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.0000000000 -0.5170084634 0.0008782182 0.2353088045 -0.3020223858 [6] 0.0036600439 0.2674644314 -0.3809375561 0.3124522494 0.0388531983 [11] -0.3459069564 0.4735762148 -0.3295331151 -0.0586064444 0.1401383431 [16] 0.0124959272 -0.1873591285 0.2884256354 -0.1854154108 0.0331903921 [21] 0.0679272931 -0.0685084385 0.0357708097 0.0213354251 -0.1252623243 [26] 0.0299911207 0.1899465349 -0.2678382903 0.1919554740 0.0246315998 [31] -0.1953676059 0.1574397274 -0.0105875480 -0.1587431924 0.1400597345 [36] -0.0482192298 -0.0552144409 0.2273970234 -0.2424521442 0.1132859308 [41] 0.0305176654 -0.1483160609 0.0748260039 0.0488661523 -0.1070558448 [46] 0.1103913891 -0.0166745780 -0.0367717102 0.0612678873 > (mypacf <- c(rpacf$acf)) [1] -0.517008463 -0.363612277 0.075393440 -0.163439651 -0.319730972 [6] 0.050878097 -0.226353423 0.024969599 0.155965133 -0.182211372 [11] 0.270771341 -0.076848956 -0.060778936 -0.284263613 0.163983391 [16] -0.124085075 -0.165502432 0.139497638 -0.144663613 0.014595629 [21] 0.142831621 0.087100285 0.034545825 -0.132967197 -0.005064056 [26] -0.047360123 -0.008757026 -0.016063002 0.014192140 -0.089557893 [31] 0.074021187 -0.026843373 0.001537355 -0.127418760 -0.009389413 [36] -0.050822089 -0.049213729 0.020315269 0.002201762 -0.049656051 [41] 0.005224345 -0.048618395 -0.086138571 -0.023107882 0.065114756 [46] -0.133676626 0.022314595 -0.056211912 > 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/3mre11292318260.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/4f1w41292318260.tab") > > try(system("convert tmp/1qiza1292318260.ps tmp/1qiza1292318260.png",intern=TRUE)) character(0) > try(system("convert tmp/2qiza1292318260.ps tmp/2qiza1292318260.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.592 0.342 1.612