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(13363,12530,11420,10948,10173,10602,16094,19631,17140,14345,12632,12894,11808,10673,9939,9890,9283,10131,15864,19283,16203,13919,11937,11795,11268,10522,9929,9725,9372,10068,16230,19115,18351,16265,14103,14115,13327,12618,12129,11775,11493,12470,20792,22337,21325,18581,16475,16581,15745,14453,13712,13766,13336,15346,24446,26178,24628,21282,18850,18822,18060,17536,16417,15842,15188,16905,25430,27962,26607,23364,20827,20506,19181,18016,17354,16256,15770,17538,26899,28915,25247,22856,19980,19856,16994,16839,15618,15883,15513,17106,25272,26731,22891,19583,16939,16757,15435,14786,13680,13208,12707,14277,22436,23229,18241,16145,13994,14780,13100,12329,12463,11532,10784,13106,19491,20418,16094,14491,13067) > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '0.3' > 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/freestat/rcomp/tmp/1uuqg1229381163.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/freestat/rcomp/tmp/2w0rc1229381163.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.947817533 0.910783313 0.870947156 0.845359262 [6] 0.818913654 0.800876332 0.781835917 0.756605949 0.728616333 [11] 0.684347212 0.641571441 0.586306190 0.551502056 0.516536308 [16] 0.471978774 0.424898131 0.384745247 0.340947877 0.294887813 [21] 0.251442892 0.208478637 0.163339960 0.123894503 0.082397953 [26] 0.040692355 0.002242402 -0.030905379 -0.060302720 -0.097639116 [31] -0.131637677 -0.157523734 -0.181282231 -0.215314494 -0.234305083 [36] -0.256882594 -0.282134315 -0.313745671 -0.351548995 -0.376784910 [41] -0.396857494 -0.408062305 -0.421719746 -0.427264417 -0.439489845 [46] -0.445961125 -0.456562844 -0.471219874 -0.474203931 -0.466840653 [51] -0.463749751 -0.463420159 -0.458213227 -0.449828935 -0.440545299 [56] -0.434960940 -0.432353300 -0.422302061 -0.415007662 -0.398392663 [61] -0.381781203 > (mypacf <- c(rpacf$acf)) [1] 0.9478175327 0.1222452006 -0.0264317900 0.1163875558 0.0159609875 [6] 0.0712953992 0.0214569826 -0.0668546016 -0.0363649854 -0.1846989795 [11] -0.0703510293 -0.1763370263 0.0798833702 0.0029149236 -0.1795238549 [16] -0.0569163791 0.0368921256 -0.0403893891 -0.0279918937 -0.0125423654 [21] 0.0012914568 -0.0815092247 0.0334255677 -0.0425611337 -0.0212354096 [26] 0.0400576992 -0.0050403129 0.0091758031 -0.0570082429 -0.0065381545 [31] 0.0653447361 0.0003926284 -0.1058402456 0.0747485137 -0.0202657211 [36] -0.0910296771 -0.1295290913 -0.1536344832 0.0666805408 0.0086086405 [41] -0.0168587498 -0.0297288886 0.0825972678 0.0116865393 -0.0224406120 [46] 0.0371642608 -0.0175562906 0.0547630901 0.0843349975 -0.1071228203 [51] -0.0246959745 0.0584368580 0.0477691844 -0.0455213826 -0.0732758920 [56] -0.0488979457 0.0357348213 -0.0691281027 0.0084379274 0.0007664542 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3vyns1229381163.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/freestat/rcomp/tmp/4l8mx1229381163.tab") > > system("convert tmp/1uuqg1229381163.ps tmp/1uuqg1229381163.png") > system("convert tmp/2w0rc1229381163.ps tmp/2w0rc1229381163.png") > > > proc.time() user system elapsed 0.822 0.424 1.003