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 = '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/1qbv41229700902.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/2lx3q1229700902.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.81822848 0.50341614 0.25815887 0.12865984 0.07317354 [7] 0.04074969 0.06407077 0.11687686 0.23549980 0.45027397 0.71452944 [13] 0.84348208 0.65164263 0.34758505 0.11460413 -0.01301917 -0.06682065 [19] -0.10007060 -0.08373734 -0.03977861 0.06359170 0.25505979 0.48074292 [25] 0.57398253 0.38737881 0.11008761 -0.09466544 -0.20635077 -0.25354708 [31] -0.28254814 -0.26416181 -0.22200774 -0.12615571 0.04741388 0.24301013 [37] 0.31389748 0.14223137 -0.09916414 -0.26584745 -0.34912226 -0.37593916 [43] -0.38983129 -0.36499367 -0.32466274 -0.23544343 -0.08147326 0.08754169 [49] 0.14496991 0.00413360 -0.18959455 -0.31501235 -0.37276864 -0.38525770 [55] -0.38513410 -0.35449530 -0.31371789 -0.23668586 -0.10692838 0.03593581 [61] 0.08642744 > (mypacf <- c(rpacf$acf)) [1] 0.818228480 -0.502513241 0.204134422 -0.012330008 -0.010777682 [6] -0.025731545 0.215777614 -0.056756697 0.396616868 0.387139339 [11] 0.516105171 -0.028229410 -0.658695627 0.214049787 -0.176784955 [16] -0.224225107 0.052112901 -0.109631271 -0.182112399 -0.102923934 [21] -0.037187584 -0.064635308 -0.101773310 0.019241742 0.011754367 [26] -0.020384034 0.054144469 -0.001519994 -0.060741302 0.048277572 [31] 0.038330129 -0.102233174 0.056375082 -0.060454034 -0.048743600 [36] -0.002646463 -0.013020245 0.003558885 0.029271519 0.033995032 [41] 0.071346484 -0.021853843 0.022612971 -0.034341816 0.018120229 [46] -0.122164140 0.060881946 -0.034001112 0.140493622 -0.107731558 [51] 0.044686774 -0.032275905 -0.039007564 0.032306450 0.030116757 [56] -0.023901603 -0.085782017 -0.023973934 0.018141322 -0.050782698 > 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/34zl91229700902.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/4e4pl1229700902.tab") > > system("convert tmp/1qbv41229700902.ps tmp/1qbv41229700902.png") > system("convert tmp/2lx3q1229700902.ps tmp/2lx3q1229700902.png") > > > proc.time() user system elapsed 0.649 0.347 1.090