R version 2.6.1 (2007-11-26) Copyright (C) 2007 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. > y <- c(92.1,91.4,90.7,92.5,94.4,94.3,87.3,85.9,89,83.3,78.6,75.7,79.6,78.5,82.6,88.7,88.5,84.6,83.4,84.4,94.1,100.4,93.1,93.1,82.1,88.1,87.7,80.2,73.8,75.3,77.3,80.1,81.3,81.5,83.2,80.8,81.3,78.8,82.8,84.9,93.2,94.7,94.8,103.9,107,118.6,112.2,112.2,93.8,96.7,108.7,112.1,107.2,113.1,120,124.4,139.5,145.8,135.6,135.5,141.6,141.2,141.6,147.1,146.5,144.1,148.5,146.9,135.7,128.5,128.7,127.6,122.5,123.4,129.4,135.3,138.5,140.6,144.2,144.3) > x <- c(37702,30364,32609,30212,29965,28352,25814,22414,20506,28806,22228,13971,36845,35338,35022,34777,26887,23970,22780,17351,21382,24561,17409,11514,31514,27071,29462,26105,22397,23843,21705,18089,20764,25316,17704,15548,28029,29383,36438,32034,22679,24319,18004,17537,20366,22782,19169,13807,29743,25591,29096,26482,22405,27044,17970,18730,19684,19785,18479,10698,31956,29506,34506,27165,26736,23691,18157,17328,18205,20995,17382,9367,31124,26551,30651,25859,25100,25778,20418,18688) > par7 = '0' > par6 = '1' > par5 = '1' > par4 = '12' > par3 = '1' > par2 = '1' > par1 = '1' > #'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!) > par1 <- as.numeric(par1) > par2 <- as.numeric(par2) > par3 <- as.numeric(par3) > par4 <- as.numeric(par4) > par5 <- as.numeric(par5) > par6 <- as.numeric(par6) > par7 <- as.numeric(par7) > if (par1 == 0) { + x <- log(x) + } else { + x <- (x ^ par1 - 1) / par1 + } > if (par5 == 0) { + y <- log(y) + } else { + y <- (y ^ par5 - 1) / par5 + } > if (par2 > 0) x <- diff(x,lag=1,difference=par2) > if (par6 > 0) y <- diff(y,lag=1,difference=par6) > if (par3 > 0) x <- diff(x,lag=par4,difference=par3) > if (par7 > 0) x <- diff(y,lag=par4,difference=par7) > x [1] 5831 -2561 2152 -7643 -1304 1348 -2029 5939 -5121 -574 2362 -2874 [13] -2936 2707 -3112 4182 4363 -948 1813 -1356 1373 -460 3739 -7519 [25] 5797 4664 -1047 -5647 194 -4177 3149 154 -2136 3999 -3206 3455 [37] -5506 -3550 1790 5278 2999 -2759 1227 -1875 -2315 2307 -2419 5322 [49] 1702 1495 -4727 3648 -7684 3540 -1589 -77 2689 -2307 -234 499 [61] -2123 -900 2549 -330 3723 174 -901 > y [1] -0.7 -0.7 1.8 1.9 -0.1 -7.0 -1.4 3.1 -5.7 -4.7 -2.9 3.9 [13] -1.1 4.1 6.1 -0.2 -3.9 -1.2 1.0 9.7 6.3 -7.3 0.0 -11.0 [25] 6.0 -0.4 -7.5 -6.4 1.5 2.0 2.8 1.2 0.2 1.7 -2.4 0.5 [37] -2.5 4.0 2.1 8.3 1.5 0.1 9.1 3.1 11.6 -6.4 0.0 -18.4 [49] 2.9 12.0 3.4 -4.9 5.9 6.9 4.4 15.1 6.3 -10.2 -0.1 6.1 [61] -0.4 0.4 5.5 -0.6 -2.4 4.4 -1.6 -11.2 -7.2 0.2 -1.1 -5.1 [73] 0.9 6.0 5.9 3.2 2.1 3.6 0.1 > postscript(file="/var/www/html/rcomp/tmp/1dqe81200947725.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > (r <- ccf(x,y,main='Cross Correlation Function',ylab='CCF',xlab='Lag (k)')) Autocorrelations of series 'X', by lag -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 0.092 0.103 0.071 -0.154 0.069 -0.144 0.128 -0.180 0.010 -0.014 -0.047 -4 -3 -2 -1 0 1 2 3 4 5 6 0.204 -0.074 0.006 -0.126 0.074 -0.003 -0.033 0.116 -0.078 0.155 0.007 7 8 9 10 11 12 13 14 15 0.017 -0.146 0.078 -0.009 0.106 -0.105 -0.051 0.077 -0.017 > dev.off() null device 1 > load(file='/var/www/html/rcomp/createtable') > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Cross Correlation Function',2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Parameter',header=TRUE) > a<-table.element(a,'Value',header=TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Box-Cox transformation parameter (lambda) of X series',header=TRUE) > a<-table.element(a,par1) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Degree of non-seasonal differencing (d) of X series',header=TRUE) > a<-table.element(a,par2) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Degree of seasonal differencing (D) of X series',header=TRUE) > a<-table.element(a,par3) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Seasonal Period (s)',header=TRUE) > a<-table.element(a,par4) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Box-Cox transformation parameter (lambda) of Y series',header=TRUE) > a<-table.element(a,par5) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Degree of non-seasonal differencing (d) of Y series',header=TRUE) > a<-table.element(a,par6) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Degree of seasonal differencing (D) of Y series',header=TRUE) > a<-table.element(a,par7) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'k',header=TRUE) > a<-table.element(a,'rho(Y[t],X[t+k])',header=TRUE) > a<-table.row.end(a) > mylength <- length(r$acf) > myhalf <- floor((mylength-1)/2) > for (i in 1:mylength) { + a<-table.row.start(a) + a<-table.element(a,i-myhalf-1,header=TRUE) + a<-table.element(a,r$acf[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/2bd1o1200947725.tab") > > system("convert tmp/1dqe81200947725.ps tmp/1dqe81200947725.png") > > > proc.time() user system elapsed 1.161 0.296 1.215