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(111.5,108.1,124.5,106.3,111.1,121.3,116.5,117.4,123.6,98.4,107.2,118.9,111.9,115.2,124.4,104.6,117,126.2,117.5,122.2,124.1,105.8,107.5,125.6,112.1,120.1,130.6,109.8,122.1,129.5,132.1,133.3,128.4,114.7,114.1,136.9,123.4,134,137,127.8,140.1,140.4,157.8,151.8,141.1,138.8,141.1,139.5,150.7,144.4,146,143.6,143.1,156.4,164.8,145.1,153.4,133.2,131.4,145.9) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/1jp6c1259781061.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/2w2jf1259781061.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.390670624 -0.200669057 0.331742125 -0.390005387 [6] -0.068009087 0.499877927 -0.216717754 -0.177999674 0.199602684 [11] -0.244204662 -0.041265846 0.484791498 -0.191707687 -0.083280943 [16] 0.070910274 -0.148516812 -0.068376147 0.276463509 -0.013553678 [21] -0.251600598 0.147401304 -0.140995106 -0.014709794 0.274564523 [26] -0.036649727 -0.097021763 -0.032198584 0.012459092 -0.074310308 [31] 0.151485604 0.021916660 -0.163345065 0.035673193 -0.009552811 [36] -0.013722689 0.093314978 > (mypacf <- c(rpacf$acf)) [1] -0.3906706238 -0.4169251902 0.0825350580 -0.3739861726 -0.4309394429 [6] 0.1280104258 0.1777491188 -0.1967482133 -0.2941924601 -0.1880409858 [11] -0.1927440831 0.1414653912 0.1400363364 0.1903792689 -0.0636333038 [16] 0.1436756655 -0.0008107195 -0.0968822444 0.0489572281 -0.1151650567 [21] -0.0502082147 -0.2021851646 -0.0158951583 -0.1325228960 -0.0975581409 [26] 0.0098132681 -0.1317388906 0.0260780358 0.0313256776 0.0346773326 [31] -0.1285987250 -0.0138330932 0.0525546753 0.0783530115 -0.0051210155 [36] -0.0810844331 > 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/3g90v1259781061.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/4da181259781061.tab") > system("convert tmp/1jp6c1259781061.ps tmp/1jp6c1259781061.png") > system("convert tmp/2w2jf1259781061.ps tmp/2w2jf1259781061.png") > > > proc.time() user system elapsed 0.537 0.294 0.640