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(130,136.7,138.1,139.5,140.4,144.6,151.4,147.9,141.5,143.8,143.6,150.5,150.1,154.9,162.1,176.7,186.6,194.8,196.3,228.8,267.2,237.2,254.7,258.2,257.9,269.6,266.9,269.6,253.9,258.6,274.2,301.5,304.5,285.1,287.7,265.5,264.1,276.1,258.9,239.1,250.1,276.8,297.6,295.4,283,275.8,279.7,254.6,234.6,176.9,148.1,122.7,124.9,121.6,128.4,144.5,151.8,167.1,173.8,203.7,199.8) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '2' > par2 = '1' > par1 = '36' > #'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/11qqf1259511948.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/2algl1259511948.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.38475366 -0.04064567 -0.04452927 -0.04433787 0.14697092 [7] -0.05900085 0.05617175 -0.26764788 0.05433030 -0.09823138 0.22397002 [13] 0.06732460 -0.23945667 0.17021553 -0.02137319 -0.04685636 0.09592720 [19] 0.03857005 -0.11210333 -0.14460644 0.13452568 0.01829395 0.09353882 [25] -0.16116054 0.02536479 0.09287106 -0.10563695 0.18566180 -0.14819527 [31] 0.02805476 -0.06789538 0.07001986 -0.01234758 -0.07404410 0.06862271 [37] -0.04566650 > (mypacf <- c(rpacf$acf)) [1] -0.3847536643 -0.2214658339 -0.1837139556 -0.1919593079 0.0280115229 [6] -0.0052639597 0.0745106371 -0.2604403784 -0.2242684870 -0.4023147628 [11] -0.1234373971 0.0682754206 -0.1079151518 0.0711498285 0.1219303363 [16] -0.1910146359 -0.1602924742 -0.0582696913 -0.0718511714 -0.2334928092 [21] -0.0715587432 0.0219899141 0.1145960389 -0.0418767787 -0.0181397903 [26] -0.0139452163 -0.1328026966 -0.0009139423 -0.1815581246 -0.0379076525 [31] 0.1010328090 0.0857214478 -0.0451254913 -0.0988218970 -0.1170357896 [36] -0.1369373723 > 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/3zsnl1259511948.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/4nvbj1259511948.tab") > system("convert tmp/11qqf1259511948.ps tmp/11qqf1259511948.png") > system("convert tmp/2algl1259511948.ps tmp/2algl1259511948.png") > > > proc.time() user system elapsed 0.545 0.314 0.670