R version 2.8.0 (2008-10-20) 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(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,20424,24776,19814,12738,31566,30111,30019,31934,25826,26835,20205,17789,20520,22518,15572) > par5 = '12' > par4 = '0' > par3 = '1' > 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/1akzk1229090991.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/2cu9l1229090991.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.332994238 0.031227306 -0.042574173 -0.072617217 [6] 0.116849174 -0.365408678 0.132194910 -0.013418048 -0.055695895 [11] -0.016517471 -0.249391908 0.744813260 -0.269392220 0.022938099 [16] -0.018275998 -0.030397419 0.099277393 -0.318227404 0.137416349 [21] -0.069064926 -0.030075512 -0.040758141 -0.126683431 0.519405536 [26] -0.145040894 0.012365660 -0.026871532 -0.012935328 0.037419350 [31] -0.214953107 0.133548075 -0.077033517 -0.006156944 -0.024335859 [36] -0.094708531 0.310753869 -0.080113093 -0.021574045 0.021756985 [41] -0.007649024 -0.007646957 -0.074484978 0.054654008 -0.043343931 [46] -0.015759720 -0.020223355 -0.023416389 0.138826309 -0.013067488 [51] -0.008501954 0.025429730 -0.034484082 -0.015662005 -0.004741023 [56] 0.011969792 -0.002383052 0.003661469 -0.033301620 0.005373834 > (mypacf <- c(rpacf$acf)) [1] -0.3329942377 -0.0895923148 -0.0692508775 -0.1228213629 0.0539366197 [6] -0.3647303450 -0.1516095535 -0.0782177495 -0.1722799571 -0.2310323474 [11] -0.5112780431 0.5124457835 0.1133121484 -0.0935492113 -0.0945408088 [16] 0.0759052149 0.0380500127 0.0281198790 0.0066468585 -0.2411537567 [21] -0.1008670010 0.0108650217 0.1378337312 -0.1397323698 0.0551396463 [26] 0.0499194906 -0.0127101348 -0.0226936929 -0.0780941326 0.0351089499 [31] 0.0507325546 0.1050248948 -0.0297937528 0.0973220355 0.0003614814 [36] -0.0733560355 -0.0625015954 -0.1239581235 0.0555518649 -0.0011565282 [41] -0.0701617219 0.0131437806 -0.0061535249 0.0715769724 0.0436274475 [46] -0.0511699889 0.0058757499 -0.0154497017 0.0028082474 0.0939794119 [51] 0.0179245388 -0.0825708020 0.0716477179 0.0248313413 -0.0031346480 [56] 0.0088516155 0.1204016603 -0.0472144368 -0.0551910540 > 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/3iagr1229090991.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/4rt321229090991.tab") > > system("convert tmp/1akzk1229090991.ps tmp/1akzk1229090991.png") > system("convert tmp/2cu9l1229090991.ps tmp/2cu9l1229090991.png") > > > proc.time() user system elapsed 0.601 0.325 0.747