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 = '1' > par3 = '0' > par2 = '0.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/1jn3s1259954778.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/23pa31259954778.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.0000000000 -0.4712962734 0.1011357321 0.0614765667 -0.1268452669 [6] 0.0796609946 -0.0268986966 -0.0255342065 0.0824788090 0.0560477626 [11] -0.0144711242 0.0519050671 -0.1767130440 0.1245937871 -0.0644431443 [16] 0.0488875745 -0.0367448873 -0.0526177948 0.0763425803 -0.0994534977 [21] 0.0278602202 0.0202221877 -0.1819114379 0.2521602143 -0.3073524646 [26] 0.0909774992 -0.0382770636 0.0110623987 0.0389412210 -0.0610811397 [31] 0.0464637696 -0.0088761981 -0.0692893623 0.0168791304 -0.0041297611 [36] -0.1203352516 0.2640939760 -0.1284421918 0.0032409518 0.0180316287 [41] -0.0362249227 0.0570593324 -0.0390493850 -0.0248445509 0.0588724662 [46] 0.0205742041 0.0053279974 0.0005355933 > (mypacf <- c(rpacf$acf)) [1] -0.471296273 -0.155531024 0.056982937 -0.071984118 -0.020404587 [6] -0.004674112 -0.029242649 0.057972994 0.170257428 0.121363258 [11] 0.105253729 -0.154311772 -0.037583955 -0.026901458 0.060699129 [16] -0.041116992 -0.139819327 -0.066459719 -0.113434123 -0.047912390 [21] 0.054990149 -0.188404304 0.087473012 -0.258155866 -0.136169446 [26] -0.143237934 0.062962950 0.055642517 -0.052658963 0.022992643 [31] 0.030001110 -0.029551881 0.057933032 -0.008487386 -0.087868963 [36] 0.049362424 0.096001191 -0.062334452 -0.054972583 -0.027653611 [41] -0.032417584 -0.007996544 -0.093287041 -0.086194769 0.009540201 [46] -0.094704177 0.022006708 > 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/37lpd1259954778.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/4sl751259954778.tab") > > system("convert tmp/1jn3s1259954778.ps tmp/1jn3s1259954778.png") > system("convert tmp/23pa31259954778.ps tmp/23pa31259954778.png") > > > proc.time() user system elapsed 0.586 0.320 0.697