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(114.1,110.3,103.9,101.6,94.6,95.9,104.7,102.8,98.1,113.9,80.9,95.7,113.2,105.9,108.8,102.3,99,100.7,115.5,100.7,109.9,114.6,85.4,100.5,114.8,116.5,112.9,102,106,105.3,118.8,106.1,109.3,117.2,92.5,104.2,112.5,122.4,113.3,100,110.7,112.8,109.8,117.3,109.1,115.9,96,99.8,116.8,115.7,99.4,94.3,91,93.2,103.1,94.1,91.8,102.7,82.6,89.1,104.5) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '60' > #'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/1riqt1261403232.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/2lflw1261403232.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.000000e+00 2.544653e-01 5.223199e-03 1.456568e-01 5.941319e-02 [6] 2.818485e-01 3.092404e-01 1.728260e-01 -1.657671e-02 -9.570572e-02 [11] -2.923910e-01 -7.335382e-03 4.266198e-01 -5.586152e-02 -2.651953e-01 [16] -2.144490e-01 -1.380024e-01 3.936910e-02 5.934877e-03 2.192648e-03 [21] -1.517694e-01 -2.154838e-01 -2.608951e-01 -7.389727e-02 2.360899e-01 [26] -5.752030e-02 -2.756858e-01 -1.949237e-01 -1.078663e-01 -2.139763e-02 [31] -3.124725e-03 -1.236903e-02 -1.480173e-01 -1.609278e-01 -1.318223e-01 [36] -8.008641e-02 1.854162e-01 1.226107e-02 -1.789011e-01 -5.785852e-02 [41] -9.720644e-03 1.407718e-02 1.200798e-01 6.522749e-02 -2.520001e-02 [46] 5.278308e-02 4.482958e-03 5.553657e-02 2.166344e-01 8.049217e-02 [51] 6.644698e-03 3.396012e-02 4.122331e-04 2.419857e-02 5.316676e-02 [56] 8.380634e-03 -1.333993e-02 -2.454322e-02 -5.466435e-02 -2.704466e-02 [61] -5.738276e-05 > (mypacf <- c(rpacf$acf)) [1] 0.2544653419 -0.0636509779 0.1722461165 -0.0275078666 0.3182211180 [6] 0.1532262426 0.1284135802 -0.1561512865 -0.1220629016 -0.4939765251 [11] 0.0156694442 0.4115310887 -0.0780726485 -0.1750567584 -0.1089013391 [16] 0.1913167099 -0.0002413289 -0.2033480458 -0.0332880293 -0.0892428531 [21] 0.0224264170 0.0545340097 -0.0741721800 -0.0757647430 -0.0255737279 [26] 0.0207616209 0.0498866077 -0.1674355911 -0.1459463580 -0.0015824495 [31] 0.0462621632 -0.0545543167 -0.0823850074 0.1045166722 -0.0981690106 [36] -0.0125667062 0.0298485338 0.0090436002 -0.0621038468 -0.0505883045 [41] -0.0752130357 0.1111638827 -0.0640106731 0.0555106335 0.0803624965 [46] -0.0455951409 0.0470583296 -0.0456110564 -0.0232307187 -0.0206508024 [51] -0.1372812929 -0.0581430727 -0.0961957272 -0.0840878405 0.0415726648 [56] 0.0891026932 -0.0283881265 -0.0249436797 0.0102993590 0.0213285283 > 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/36pe61261403232.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/4c0or1261403232.tab") > > try(system("convert tmp/1riqt1261403232.ps tmp/1riqt1261403232.png",intern=TRUE)) character(0) > try(system("convert tmp/2lflw1261403232.ps tmp/2lflw1261403232.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.601 0.331 1.306