R version 2.7.0 (2008-04-22) Copyright (C) 2008 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(83.1,89.6,105.7,110.7,110.4,109,106,100.9,114.3,101.2,109.2,111.6,91.7,93.7,105.7,109.5,105.3,102.8,100.6,97.6,110.3,107.2,107.2,108.1,97.1,92.2,112.2,111.6,115.7,111.3,104.2,103.2,112.7,106.4,102.6,110.6,95.2,89,112.5,116.8,107.2,113.6,101.8,102.6,122.7,110.3,110.5,121.6,100.3,100.7,123.4,127.1,124.1,131.2,111.6,114.2,130.1,125.9,119,133.8,107.5,113.5,134.4,126.8,135.6,139.9,129.8,131,153.1,134.1,144.1,155.9,123.3,128.1,144.3,153,149.9,150.9,141,138.9,157.4,142.9,151.7,161,138.5,135.9,151.5,164,159.1,157,142.1,144.8,152.1,154.6,148.7,157.7,146.7) > 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: Write here your technical program description (don't use hard returns!) > 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 (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/1hga21228765546.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x,par1,main='Autocorrelation',xlab='lags',ylab='ACF') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2lag61228765546.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.81999205 0.72167832 0.75621110 0.68997913 0.72108261 [7] 0.79796525 0.68925971 0.61628667 0.64407808 0.54418890 0.58885377 [13] 0.70061131 0.56070321 0.45948636 0.47642753 0.41168826 0.42523127 [19] 0.48937057 0.37206956 0.30518021 0.31273333 0.22621239 0.25901127 [25] 0.33864636 0.22650906 0.12864709 0.13293087 0.06524735 0.07911045 [31] 0.12314715 0.03611192 -0.02272443 -0.02047760 -0.08430883 -0.05899447 [37] 0.01922557 -0.07278131 -0.14872367 -0.14292161 -0.18404631 -0.17353811 [43] -0.12975912 -0.19620322 -0.24265874 -0.24043449 -0.29543313 -0.27167321 [49] -0.20722309 -0.26743171 -0.32839936 -0.32097610 -0.34471116 -0.32679098 [55] -0.28132738 -0.32041934 -0.34498633 -0.33438511 -0.36112292 -0.34067697 [61] -0.27416909 > (mypacf <- c(rpacf$acf)) [1] 0.8199920531 0.1504560224 0.4063228597 -0.1050067100 0.4110826236 [6] 0.2262751817 -0.2210959993 -0.0979254437 0.0381537404 -0.2969655404 [11] 0.3615938275 0.1506805856 -0.3537822017 -0.1974747085 0.0292309486 [16] 0.0443198040 -0.0203627897 -0.0872504578 -0.0613297087 0.0090214000 [21] -0.0702931171 0.0850941588 0.0629358951 -0.0932718293 -0.0418060678 [26] -0.0842931369 -0.0054491996 -0.0669672572 -0.0332996752 -0.0892656692 [31] 0.1400868625 -0.0783604343 0.0843087867 -0.0080358228 0.0453991211 [36] 0.0264826107 -0.0752158910 -0.0563779710 0.0648158494 -0.0503442927 [41] -0.0697089445 -0.0002862950 -0.0340175665 0.0409465590 -0.0753377743 [46] -0.0174772238 0.0022136805 -0.0649422672 0.0268161631 0.0233608653 [51] -0.0278904167 -0.0113795716 0.0479653271 -0.0307904417 0.1092186664 [56] -0.0616219768 0.0395276713 0.0089217103 -0.0671896115 0.0245641292 > 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/3i6k61228765546.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/4fbqx1228765546.tab") > > system("convert tmp/1hga21228765546.ps tmp/1hga21228765546.png") > system("convert tmp/2lag61228765546.ps tmp/2lag61228765546.png") > > > proc.time() user system elapsed 1.541 0.547 1.643