R version 2.7.0 (2008-04-22) 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(31.58,27.88,27.32,28.89,28.05,28.73,32.00,34.53,33.47,34.09,35.47,34.59,34.32,32.78,28.38,29.18,28.62,28.20,29.33,29.72,26.29,26.82,27.64,27.10,27.05,26.02,25.76,25.94,24.97,21.74,18.16,16.95,16.46,16.44,18.20,16.44,15.70,13.94,12.23,14.75,14.62,15.04,15.50,16.10,15.44,15.14,15.42,15.69,17.57,18.42,17.96,18.39,17.63,17.95,17.79,17.73,18.99,19.83,20.23,20.24,21.12,21.25,21.80,21.84,22.21,22.64,23.54,23.78,23.65,23.93,24.77,26.26,27.69,29.54,29.31,29.26,28.69,26.16,27.12,29.40,30.99,32.96,32.20,31.67,32.49,33.66,32.44,34.38,32.36,30.73,30.31,27.26,25.05,22.33,18.26,18.30,16.00,14.36,14.98,16.88,16.56,13.31,9.61,9.34,7.89,1.71,0.81,0.71) > 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/1pwln1229501230.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/2hg1d1229501230.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.304775535 0.081804988 0.224776686 0.026405460 [6] 0.033455360 0.084228241 0.013870523 0.116210827 0.146904925 [11] 0.003924509 0.061315027 0.158674657 0.051705906 0.053346057 [16] 0.106129190 0.111014824 0.045810569 -0.057631414 -0.003162940 [21] -0.130788399 -0.107363486 -0.100901360 -0.112576315 -0.030720237 [26] -0.077586106 -0.131897155 -0.039570953 -0.013809445 -0.056671847 [31] -0.041932872 -0.075106569 -0.079655842 -0.057047826 -0.096152161 [36] -0.149621064 -0.034979985 -0.052080439 -0.069138927 0.023983277 [41] -0.068904722 -0.062537136 -0.057092765 -0.150562401 -0.095285766 [46] -0.080228319 -0.064031967 -0.045350859 -0.061759816 -0.125005284 [51] -0.070440332 -0.015678333 -0.087262554 -0.019880372 -0.042039754 [56] -0.079939709 -0.008832778 -0.027462667 -0.034559975 -0.023730981 [61] 0.021695787 > (mypacf <- c(rpacf$acf)) [1] 0.3047755351 -0.0122180509 0.2241112935 -0.1221255936 0.0716644188 [6] 0.0062288499 0.0076052317 0.1150884855 0.0643236364 -0.0587620031 [11] 0.0421222208 0.1062451087 -0.0062531857 0.0176561170 0.0392482175 [16] 0.0848128458 -0.0558296466 -0.1055531000 0.0306081040 -0.2056682770 [21] 0.0007779789 -0.1187005243 -0.0065352855 -0.0376840812 -0.0753740825 [26] -0.0569699425 0.0024159530 0.0165380174 0.0129537567 -0.0031078196 [31] -0.0574859192 0.0243573322 -0.0078197349 0.0207045549 -0.0835356490 [36] 0.0847420923 0.0070620920 0.0086374556 0.0832392646 -0.1249355374 [41] 0.0421984731 -0.1080061802 -0.0795131361 -0.0477370355 -0.0938823394 [46] 0.0283093842 -0.0595686008 -0.0406708624 -0.1221198313 0.0278666408 [51] -0.0078078851 -0.0386492360 0.0012205257 -0.0332764105 -0.0430380689 [56] 0.0373388465 0.0409775865 -0.0046077888 0.0590347950 0.0403553961 > 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/3npdr1229501230.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/4hfb81229501230.tab") > > system("convert tmp/1pwln1229501230.ps tmp/1pwln1229501230.png") > system("convert tmp/2hg1d1229501230.ps tmp/2hg1d1229501230.png") > > > proc.time() user system elapsed 1.552 0.557 1.645