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 = '1' > 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/1tmtl1229858527.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/2wzul1229858527.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.0000000000 0.1393854001 -0.1073516807 0.0545346500 -0.1250831009 [6] 0.0933326732 -0.0699287018 -0.1990377735 0.0758618853 0.1050516879 [11] -0.1444225488 -0.1245918391 0.0123856485 0.0276969362 0.2104253037 [16] 0.0379273713 -0.0488808913 0.0881099836 -0.0238263388 -0.1293579748 [21] -0.1400338760 -0.0871991992 0.0038557585 -0.0100333840 -0.0280660167 [26] 0.0498733758 0.0835915113 0.0778771891 -0.0288412716 -0.0927127219 [31] -0.0001343330 0.0402323885 0.0335100037 -0.0666796454 -0.0862322370 [36] -0.1174231905 -0.0592936333 -0.0675305384 -0.0748494523 0.1996096393 [41] 0.1018762643 0.0043767065 -0.0254159450 -0.1395511291 0.0387273885 [46] -0.0287216046 -0.1052653336 -0.0647751981 0.0273456385 0.0311915950 [51] -0.0774215849 -0.0840797526 -0.0234381968 0.1307713207 0.1067306835 [56] -0.0717194032 0.0373469335 0.0932521096 0.0445735964 0.0024448544 > (mypacf <- c(rpacf$acf)) [1] 1.393854e-01 -1.292919e-01 9.277721e-02 -1.702102e-01 1.750296e-01 [6] -1.868368e-01 -8.743722e-02 5.629460e-02 1.052266e-01 -2.181589e-01 [11] -6.507223e-02 5.123961e-02 2.331425e-03 1.641647e-01 3.839532e-03 [16] 3.278397e-02 -3.832773e-02 8.535507e-03 -1.271655e-01 -9.560857e-02 [21] -4.065566e-02 -2.543172e-02 -6.792741e-02 4.924862e-02 9.858957e-02 [26] 3.545413e-03 7.044136e-02 -7.478702e-02 -9.330423e-02 -6.709436e-02 [31] 2.773266e-02 3.081649e-02 -5.842756e-02 -1.411901e-05 -1.461486e-01 [36] 5.265658e-03 -8.019995e-02 -1.056914e-02 1.223707e-01 -3.371867e-02 [41] -3.352415e-02 -9.969541e-02 -4.278921e-02 5.235397e-03 -7.389535e-02 [46] -4.422539e-02 -1.139617e-01 3.182742e-02 5.996160e-04 -2.290769e-02 [51] -7.839124e-02 -5.117682e-03 -2.652232e-02 7.455781e-03 -9.582268e-02 [56] 3.781641e-02 1.468829e-02 9.292193e-03 5.194030e-02 > 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/3ld1r1229858527.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/400nj1229858527.tab") > > system("convert tmp/1tmtl1229858527.ps tmp/1tmtl1229858527.png") > system("convert tmp/2wzul1229858527.ps tmp/2wzul1229858527.png") > > > proc.time() user system elapsed 0.568 0.316 0.692