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 = '0' > par3 = '1' > 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/1kegu1229381042.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/2g3y21229381043.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.38835249 -0.17298053 -0.30624302 -0.23513580 -0.10338927 [7] -0.14945967 -0.08107624 -0.19973486 -0.26724525 -0.12325603 0.38982283 [13] 0.87877823 0.32462807 -0.16419214 -0.26788145 -0.23294126 -0.09968870 [19] -0.12639305 -0.07591059 -0.18238700 -0.23326803 -0.08511073 0.36827178 [25] 0.76224516 0.26562578 -0.15773407 -0.23656942 -0.20594775 -0.09222105 [31] -0.12011595 -0.06789663 -0.15949219 -0.20279616 -0.05514016 0.35004953 [37] 0.66336999 0.20917194 -0.17179605 -0.21643845 -0.18553462 -0.07736909 [43] -0.09066946 -0.04797497 -0.14396184 -0.17511687 -0.03464306 0.31285639 [49] 0.55516545 0.16394151 -0.16028758 -0.18553835 -0.15941432 -0.06955898 [55] -0.06787942 -0.02946017 -0.11515362 -0.15020049 -0.03382524 0.26719653 [61] 0.46380413 > (mypacf <- c(rpacf$acf)) [1] 0.388352487 -0.381305841 -0.090075691 -0.144470786 -0.073816059 [6] -0.276726763 -0.026209977 -0.468294988 -0.364252263 -0.557934930 [11] 0.078722721 0.608783027 -0.258729470 0.198107203 0.139576659 [16] 0.006639508 0.197850264 0.120147169 0.010641018 0.118511466 [21] 0.105988098 -0.002408526 0.024040141 0.010193419 -0.054391330 [26] -0.053736578 -0.037524452 0.016204770 -0.123251286 -0.083420147 [31] 0.023424639 -0.100467808 -0.035411346 0.005943418 -0.025919774 [36] -0.010074283 0.014585132 -0.127345414 -0.004690136 -0.093564976 [41] -0.024517930 0.009517472 -0.038760498 -0.055410446 0.072801230 [46] -0.098726606 -0.036891318 -0.092726653 -0.013064232 -0.029232461 [51] 0.004129115 -0.025958289 -0.030164069 -0.034353004 0.064348035 [56] 0.053071716 -0.009974280 0.016400705 0.043919961 -0.027313531 > 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/3p9fc1229381043.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/4fl1v1229381043.tab") > > system("convert tmp/1kegu1229381042.ps tmp/1kegu1229381042.png") > system("convert tmp/2g3y21229381043.ps tmp/2g3y21229381043.png") > > > proc.time() user system elapsed 0.824 0.426 0.957