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(11.1,10.9,10,9.2,9.2,9.5,9.6,9.5,9.1,8.9,9,10.1,10.3,10.2,9.6,9.2,9.3,9.4,9.4,9.2,9,9,9,9.8,10,9.8,9.3,9,9,9.1,9.1,9.1,9.2,8.8,8.3,8.4,8.1,7.7,7.9,7.9,8,7.9,7.6,7.1,6.8,6.5,6.9,8.2,8.7,8.3,7.9,7.5,7.8,8.3,8.4,8.2,7.7,7.2,7.3,8.1) > 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/14aor1259063378.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/29m4d1259063378.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.00000000 0.86346428 0.65583986 0.52258168 0.50980700 0.55809063 [7] 0.57843040 0.52621222 0.43134082 0.37121698 0.37769502 0.42675282 [13] 0.42249409 0.34155789 0.23789363 0.17214713 0.13921558 0.11200277 [19] 0.07099038 0.01290654 -0.04067352 -0.06345035 -0.05452545 -0.03032045 [25] -0.05660085 -0.13252469 -0.20612599 -0.23242900 -0.22865210 -0.21935425 [31] -0.23168251 -0.27198287 -0.32829233 -0.36384591 -0.34251157 -0.28761071 [37] -0.26571693 -0.28386000 -0.30881809 -0.31938891 -0.30198762 -0.28097539 [43] -0.28514935 -0.32039779 -0.34981446 -0.32900566 -0.23726073 -0.13477903 [49] -0.10196200 -0.12741172 -0.15769299 -0.15867418 -0.12250615 -0.08972303 [55] -0.08718369 -0.10888684 -0.13383928 -0.12813542 -0.08118541 -0.02570250 > (mypacf <- c(rpacf$acf)) [1] 0.863464284 -0.352674256 0.274219292 0.259545610 0.111102236 [6] -0.002533465 -0.063536823 -0.030852043 0.090823094 0.066131295 [11] 0.077429937 -0.176836958 -0.076346186 -0.014915853 -0.041256100 [16] -0.165178717 -0.097089115 -0.038471746 -0.033768464 -0.029464740 [21] 0.015511528 0.005826698 0.099580709 -0.148720760 -0.051780983 [26] -0.016063506 0.037472197 -0.052600215 0.022162407 -0.028046095 [31] -0.019272149 -0.115382354 -0.022042792 0.041756991 0.059411496 [36] -0.080350824 0.068091870 0.005905635 -0.007071750 0.026389859 [41] -0.059718380 -0.106602077 -0.045375837 0.015156393 0.095400758 [46] 0.132352575 0.074686011 -0.070468268 0.043178989 -0.046030950 [51] -0.078617429 -0.026480007 -0.076376088 0.005004244 0.036411435 [56] -0.068614721 -0.035546075 -0.063152044 0.020265019 > 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/3u9fd1259063378.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/4mpx11259063378.tab") > > system("convert tmp/14aor1259063378.ps tmp/14aor1259063378.png") > system("convert tmp/29m4d1259063378.ps tmp/29m4d1259063378.png") > > > proc.time() user system elapsed 0.587 0.316 3.228