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 = '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/1p9201229380908.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/2dqy71229380908.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.829924602 0.531515897 0.291278199 0.157463389 [6] 0.099688558 0.068702461 0.091055042 0.145469128 0.265222013 [11] 0.470427693 0.715598870 0.833783134 0.656807284 0.373016158 [16] 0.145339769 0.012233184 -0.045133671 -0.077698144 -0.062705698 [21] -0.017953799 0.084864694 0.264128861 0.469930222 0.554662026 [26] 0.385113334 0.129170131 -0.071640660 -0.190314742 -0.242360541 [31] -0.271388441 -0.254160374 -0.210704018 -0.115304885 0.046884038 [36] 0.225011697 0.290028210 0.133338586 -0.090857756 -0.256179678 [41] -0.346616077 -0.377470268 -0.390986794 -0.367018487 -0.324989958 [46] -0.234602621 -0.087855289 0.069495696 0.124315222 -0.006286131 [51] -0.190371675 -0.318921669 -0.384402921 -0.399681919 -0.398515641 [56] -0.367806721 -0.324963203 -0.244353434 -0.115373745 0.023081449 [61] 0.073462277 > (mypacf <- c(rpacf$acf)) [1] 0.829924602 -0.505289971 0.201153500 -0.003750661 0.007000113 [6] -0.029861986 0.224309792 -0.033265337 0.397835503 0.362633922 [11] 0.499865966 -0.072782646 -0.632385899 0.245191543 -0.208736303 [16] -0.207532990 0.053628832 -0.123286150 -0.178771906 -0.081786832 [21] -0.025927924 -0.078925257 -0.086497196 0.033680108 -0.025038794 [26] -0.022506366 0.059357025 -0.023378090 -0.073283227 0.066361040 [31] 0.024138627 -0.108940104 0.076496590 -0.029008529 -0.056819156 [36] -0.001785592 -0.036799918 0.001679707 0.038965826 0.027178799 [41] 0.059402117 -0.024235745 0.008589330 -0.039301405 0.046110748 [46] -0.096816414 0.073826704 -0.037173081 0.115819514 -0.116304163 [51] 0.057764145 -0.038545474 -0.043574467 0.036006541 0.022317320 [56] -0.067185026 -0.056324453 0.025252270 -0.025377719 -0.044302423 > 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/3dvck1229380908.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/4vin41229380908.tab") > > system("convert tmp/1p9201229380908.ps tmp/1p9201229380908.png") > system("convert tmp/2dqy71229380908.ps tmp/2dqy71229380908.png") > > > proc.time() user system elapsed 0.819 0.419 0.951