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(96.2,96.8,109.9,88,91.1,106.4,68.6,100.1,108,106,108.6,91.5,99.2,98,96.6,102.8,96.9,110,70.5,101.9,109.6,107.8,113,93.8,108,102.8,116.3,89.2,106.7,112.1,74.2,108.8,111.5,118.8,118.9,97.6,116.4,107.9,121.2,97.9,113.4,117.6,79.6,115.9,115.7,129.1,123.3,96.7,121.2,118.2,102.1,125.4,116.7,121.3,85.3,114.2,124.4,131,118.3,99.6) > 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/1b1za1259859728.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/214hz1259859728.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.061515999 0.118556442 0.148130303 0.048635329 [6] 0.364919165 0.008470479 0.298601781 0.091024628 0.053878951 [11] 0.047779786 0.053232211 0.618693370 -0.001694932 0.013064066 [16] 0.046882340 -0.088080623 0.185022503 -0.095749141 0.117024242 [21] -0.034477703 -0.040144950 -0.113406404 -0.020858102 0.329100873 [26] -0.124898880 -0.075415584 -0.096925807 -0.167175467 0.037906506 [31] -0.169331878 -0.011337504 -0.110240988 -0.145097161 -0.153179207 [36] -0.114009021 0.161826271 -0.170649806 -0.110134838 -0.157170409 [41] -0.173812318 -0.017423429 -0.144690542 -0.065027234 -0.073741794 [46] -0.185392368 -0.093881415 -0.064013274 0.009752274 -0.072598019 [51] -0.077693135 -0.088126577 -0.103488094 -0.034892510 -0.038937045 [56] -0.024525783 -0.021660516 -0.033744464 -0.005689953 0.005299353 > (mypacf <- c(rpacf$acf)) [1] 0.0615159988 0.1152081964 0.1369188318 0.0225091581 0.3423715324 [6] -0.0489418629 0.2730191115 -0.0258008723 0.0328258904 -0.1808248424 [11] 0.0902501785 0.5296873233 -0.0881477534 -0.1834224382 -0.1107949327 [16] -0.1600625872 -0.1492993722 -0.0800612686 -0.0518393326 -0.1164097063 [21] 0.1249188215 -0.0986242095 0.0545898781 0.0178562794 -0.0078606789 [26] -0.0772722774 -0.0072843644 -0.0454622304 -0.0193085981 -0.0057976709 [31] -0.0183720596 -0.0382562411 -0.0518666144 0.0287401876 -0.0919819242 [36] -0.0048785579 0.0118709972 0.0009437244 -0.0345896161 0.0456017399 [41] -0.0096443527 0.0396072446 -0.0335486894 0.0541246827 -0.1308232440 [46] 0.0995797646 0.0129535788 -0.1695812600 0.0309298711 0.0864737630 [51] 0.0049807355 -0.0014577009 -0.0198620195 0.0003352184 -0.0099886741 [56] 0.0430811589 0.1015481551 0.0515662623 -0.0587939232 > 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/33i6o1259859728.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/4l6ok1259859728.tab") > > system("convert tmp/1b1za1259859728.ps tmp/1b1za1259859728.png") > system("convert tmp/214hz1259859728.ps tmp/214hz1259859728.png") > > > proc.time() user system elapsed 0.608 0.327 1.429