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(88900,87280,85519,83647,81616,80100,94027,102327,104296,101593,94816,93535,93618,92330,90751,88576,86102,85494,103432,108870,109713,106960,103195,102348,102158,100431,97649,95611,93035,93579,111777,116065,116609,112934,107660,107965,107772,106201,102288,99217,96511,96456,113021,117836,118492,113922,109317,107496,105524,103824,101833,99436,96915,96072,111941,116008,117557,113445,108762,106661,102824,101912,99005,97894,96256,95606,108948,111223,113142,106078,100992,97413) > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '-2.0' > 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/1btwu1229287155.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/2z2km1229287155.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.90164116 0.80546284 0.72840517 0.69511892 0.65815674 [7] 0.61808202 0.58507837 0.55448706 0.53427175 0.50698109 0.48276243 [13] 0.42517520 0.37021585 0.32043983 0.27244788 0.21538196 0.16100227 [19] 0.10488289 0.05711686 0.02801531 0.01220172 -0.00842429 -0.05194416 [25] -0.11027182 -0.15991567 -0.18534009 -0.20787072 -0.22798498 -0.26682934 [31] -0.32031072 -0.34833893 -0.35601278 -0.36443104 -0.36048695 -0.35385732 [37] -0.35026808 -0.35177569 -0.36147252 -0.36439532 -0.37897790 -0.39485803 [43] -0.40725784 -0.37496366 -0.35652491 -0.33549101 -0.31567973 -0.29003530 [49] -0.26176228 -0.22374409 -0.18620972 -0.18975471 -0.20553999 -0.21512078 [55] -0.18430765 -0.14797839 -0.12448787 -0.09872814 -0.06440190 -0.03157298 > (mypacf <- c(rpacf$acf)) [1] 9.016412e-01 -4.006530e-02 4.923496e-02 1.915099e-01 -2.844853e-02 [6] 4.366699e-05 6.371813e-02 -9.844457e-03 5.137440e-02 -2.213017e-02 [11] 1.323816e-02 -1.781359e-01 -2.848629e-02 -2.481571e-02 -9.825164e-02 [16] -8.633197e-02 -2.895394e-02 -1.040158e-01 -2.638360e-02 4.760057e-02 [21] 4.288579e-02 -3.242637e-02 -7.510733e-02 -1.029926e-01 -2.797967e-02 [26] 5.919147e-02 -8.138530e-03 9.305476e-03 -9.433971e-02 -1.530291e-01 [31] 5.360231e-02 2.064176e-02 -4.022943e-02 1.391830e-01 2.993690e-02 [36] -5.232057e-02 -1.403857e-02 -3.419715e-02 2.123547e-02 -6.684069e-02 [41] -2.419069e-02 -7.337828e-02 1.412537e-01 -7.049505e-02 2.600924e-02 [46] 6.711175e-02 1.948476e-03 -1.786894e-02 8.639185e-02 1.184609e-02 [51] -1.639504e-01 -3.076257e-02 1.405055e-02 1.454086e-02 4.341764e-02 [56] -5.271494e-02 6.049211e-03 5.570971e-02 4.603742e-03 > 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/3l3ze1229287155.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/4memd1229287155.tab") > > system("convert tmp/1btwu1229287155.ps tmp/1btwu1229287155.png") > system("convert tmp/2z2km1229287155.ps tmp/2z2km1229287155.png") > > > proc.time() user system elapsed 0.589 0.327 0.701