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(1995,1947,1766,1635,1833,1910,1960,1970,2061,2093,2121,2175,2197,2350,2440,2409,2473,2408,2455,2448,2498,2646,2757,2849,2921,2982,3081,3106,3119,3061,3097,3162,3257,3277,3295,3364,3494,3667,3813,3918,3896,3801,3570,3702,3862,3970,4139,4200,4291,4444,4503,4357,4591,4697,4621,4563,4203,4296,4435,4105,4117) > 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/1tyel1229858338.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/2rt6i1229858338.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.96840096 0.93210498 0.88511828 0.83476787 0.79108874 [7] 0.73904857 0.68620178 0.63324650 0.58123462 0.53084101 0.47876242 [13] 0.42917601 0.38098377 0.33605852 0.28950658 0.24327772 0.19998253 [19] 0.15537052 0.11347810 0.06774560 0.02217896 -0.02030342 -0.05954268 [25] -0.09486331 -0.12580336 -0.15455896 -0.18180394 -0.21015652 -0.23816528 [31] -0.26510665 -0.29072771 -0.31547434 -0.34027363 -0.36399551 -0.38614691 [37] -0.40354186 -0.41625031 -0.42276211 -0.42308847 -0.42210266 -0.42052139 [43] -0.42041289 -0.42580065 -0.42509983 -0.42252995 -0.41575584 -0.40379885 [49] -0.38754470 -0.36642600 -0.34136668 -0.31222527 -0.28437739 -0.24948997 [55] -0.21186168 -0.17703004 -0.14100537 -0.11245185 -0.07902294 -0.04499274 [61] -0.02219242 > (mypacf <- c(rpacf$acf)) [1] 9.684010e-01 -9.156727e-02 -1.866559e-01 -5.955338e-02 1.176774e-01 [6] -1.663537e-01 -7.076082e-02 9.851423e-03 1.892874e-02 -5.322248e-02 [11] -6.558266e-02 2.217694e-02 -8.850241e-05 -6.535092e-03 -9.445643e-02 [16] -1.988323e-02 2.876632e-02 -6.748967e-02 -3.909519e-02 -8.880804e-02 [21] -1.552068e-02 6.394033e-03 1.176106e-02 -2.354144e-02 3.706723e-02 [26] -9.944593e-03 -5.028485e-02 -8.593610e-02 -2.478052e-02 -8.947174e-03 [31] -4.108655e-02 -5.419203e-02 -4.211427e-02 -6.274479e-03 -1.778954e-02 [36] 1.397763e-02 2.669985e-02 5.683837e-02 4.058500e-02 -5.299804e-02 [41] -6.353277e-02 -5.643268e-02 -1.269376e-01 5.444236e-02 2.295471e-02 [46] 1.876036e-02 4.698306e-02 9.655073e-02 3.046320e-02 1.626825e-02 [51] 4.218042e-02 -4.936169e-02 9.350485e-02 3.026488e-02 -1.020350e-01 [56] -2.391706e-02 -5.657427e-02 9.385842e-02 2.918198e-02 -1.698163e-01 > 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/3yi3q1229858339.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/48h7a1229858339.tab") > > system("convert tmp/1tyel1229858338.ps tmp/1tyel1229858338.png") > system("convert tmp/2rt6i1229858338.ps tmp/2rt6i1229858338.png") > > > proc.time() user system elapsed 0.598 0.323 0.719