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(14897,13063,12604,13630,14421,13978,12928,13430,13470,14786,14292,14309,14013,13241,12153,14290,15669,14170,14570,14469,14265,15321,14434,13692,14194,13519,11858,14616,15643,14077,14888,14160,14643,17193,15386,14287,17527,14497,14398,16630,16671,16615,16869,15664,16360,18448,16889,16505,18321,15052,15700,18135,16769,18883,19021,18102,17776,21490,17065,18690,18953,16399,16896,18553,19270,19422,17579,18637,18077,20439,18075,19563,19899,19228,17790,19221,22059,21231,19504,23913,23166,23574,25002,22604,23409) > 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/1xygc1228762404.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/2y3au1228762404.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.82238260 0.76362411 0.75366949 0.65949396 0.61922547 [7] 0.60303285 0.53076393 0.50685658 0.48712611 0.42715115 0.45749824 [13] 0.51121813 0.39671500 0.35777508 0.36417201 0.30714782 0.31970911 [19] 0.30851472 0.26920821 0.25592954 0.23309433 0.19664537 0.23319446 [25] 0.25157436 0.18824762 0.14138279 0.12071129 0.06332271 0.06018851 [31] 0.01610551 -0.01700588 -0.04621153 -0.06897409 -0.09373567 -0.06807722 [37] -0.05044602 -0.09681769 -0.13499757 -0.15377015 -0.17699397 -0.18634542 [43] -0.20187170 -0.21148226 -0.23297125 -0.26243180 -0.26428328 -0.26119512 [49] -0.23772870 -0.27768227 -0.31121305 -0.31758169 -0.33120015 -0.34160646 [55] -0.33127274 -0.33515083 -0.33448910 -0.33854276 -0.32860934 -0.30013634 [61] -0.26749794 > (mypacf <- c(rpacf$acf)) [1] 0.8223825957 0.2697390129 0.2440341635 -0.1355823748 0.0328994878 [6] 0.0683934259 -0.0721495676 0.0416134079 0.0179849427 -0.0526041718 [11] 0.1993091798 0.2587750677 -0.3622933654 -0.1934070476 0.0838870164 [16] 0.1103526246 0.1305228506 -0.0956216554 -0.0422843901 -0.0639898684 [21] 0.0570818004 0.0525097229 0.0057516761 -0.0397890622 -0.0150998347 [26] -0.1412475029 -0.0833467283 -0.0725269363 0.0313245613 -0.0842543946 [31] 0.0455485081 -0.0412554106 0.0821057375 -0.0282823805 -0.0166276603 [36] -0.0083243198 -0.0844923632 -0.0538105962 -0.0222252039 0.0277385183 [41] -0.0549999607 -0.0008738447 0.0522654879 -0.0377835297 -0.0830828304 [46] 0.0084070228 -0.0432709997 0.0306551937 -0.0585453572 -0.0412471472 [51] -0.0103800155 0.0010560900 0.0134082615 0.0194093428 -0.0103692600 [56] 0.0718092418 0.0341016629 -0.0579308064 0.0017158305 -0.0471210669 > 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/3l0cg1228762404.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/4ku7b1228762404.tab") > > system("convert tmp/1xygc1228762404.ps tmp/1xygc1228762404.png") > system("convert tmp/2y3au1228762404.ps tmp/2y3au1228762404.png") > > > proc.time() user system elapsed 1.549 0.545 1.650