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(102.80,118.72,119.01,118.61,120.43,111.83,116.79,131.71,120.57,117.83,130.80,107.46,112.09,129.47,119.72,134.81,135.80,129.27,126.94,153.45,121.86,133.47,135.34,117.10,120.65,132.49,137.60,138.69,125.53,133.09,129.08,145.94,129.07,139.69,142.09,137.29,127.03,137.25,156.87,150.89,139.14,158.30,149.00,158.36,168.06,153.38,173.86,162.47,145.17,168.89,166.64,140.07,128.84,123.40,120.30,129.66,118.12,113.91,131.09,119.14,115.33) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > 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/1keck1259965567.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/2zn0w1259965567.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.65223147 0.57300877 0.63308677 0.46474463 0.40779956 [7] 0.37901236 0.18542971 0.18090890 0.12633616 -0.04242735 0.02894152 [13] 0.10715026 -0.10668617 -0.11813473 -0.09441184 -0.08880929 -0.07475116 [19] -0.07941865 -0.08242496 -0.04378523 -0.11563721 -0.08408072 -0.05332852 [25] -0.02320660 -0.06733475 -0.17450996 -0.11179001 -0.05103079 -0.13680852 [31] -0.11123652 -0.09636832 -0.17786609 -0.20753582 -0.19154402 -0.25957504 [37] -0.19427261 > (mypacf <- c(rpacf$acf)) [1] 0.652231472 0.256881995 0.349952236 -0.134715214 -0.007375342 [6] -0.051365910 -0.245179590 0.038696265 -0.069992460 -0.132564558 [11] 0.160731846 0.287136132 -0.250630243 -0.191459136 -0.070207441 [16] 0.254732364 -0.019435590 0.005183978 0.086303554 -0.061408262 [21] -0.235241996 0.131231159 -0.061946352 -0.006598536 0.032346067 [26] -0.148468977 0.067120335 -0.011931836 0.006247086 -0.013377558 [31] -0.068074449 -0.105667953 -0.105852847 -0.056383992 -0.076994355 [36] 0.005459089 > 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/3epre1259965567.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/4gufs1259965567.tab") > system("convert tmp/1keck1259965567.ps tmp/1keck1259965567.png") > system("convert tmp/2zn0w1259965567.ps tmp/2zn0w1259965567.png") > > > proc.time() user system elapsed 0.533 0.322 0.703