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(108.65,107.03,104.21,108.65,101.45,100.34,112.6,118.56,119.32,116.97,109.56,109.58,110.74,110.41,109.44,107.3,105.78,105.99,120.23,122.17,121.66,120.64,118.46,119.16,120.77,120.27,118.62,118.44,116.51,117.94,132.44,134.86,134.46,131.54,127.33,129.06,130.81,130.47,129.19,126.46,124.84,126.25,138.07,142.08,142.51,142.21,138.22,138.52,137.45,137.11,135.95,133.32,132.01,132.37,144.4,146.3,146.14,142.4,138.51,138.91,138.04,137.27,134.88,133.58,133.24,133.28,144.13,145.58,144.21,136.7,131.61,129.64,130.41,127.68,123.68,122.34,118.88,116,129.19,131.34,126,122.61,118.6,119.63) > 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/16mpe1229448782.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/28zli1229448782.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.91422047 0.79371080 0.69761155 0.64753418 0.62910874 [7] 0.60053097 0.55847960 0.52346281 0.52703289 0.56098776 0.59842061 [13] 0.60271187 0.50482804 0.38342421 0.28793829 0.22383770 0.19056364 [19] 0.15299528 0.11438191 0.07610224 0.06907870 0.08687166 0.11085905 [25] 0.10775818 0.02141154 -0.08290094 -0.16053693 -0.20667063 -0.22676148 [31] -0.25177625 -0.27380577 -0.29192455 -0.28336454 -0.25579351 -0.22659810 [37] -0.21530314 -0.26785348 -0.33539874 -0.38221470 -0.40595994 -0.40899053 [43] -0.41266784 -0.41632505 -0.41586545 -0.39213079 -0.34970613 -0.30653040 [49] -0.27794968 -0.30395302 -0.33992446 -0.35326299 -0.34949860 -0.33028730 [55] -0.31269244 -0.29265135 -0.26845673 -0.22942502 -0.18741185 -0.14787566 [61] -0.11868701 > (mypacf <- c(rpacf$acf)) [1] 0.9142204743 -0.2563218160 0.1324895784 0.1705079153 0.0915161232 [6] -0.0840938664 0.0116793770 0.0887837767 0.2047540855 0.1120921021 [11] 0.0747635676 -0.0602598305 -0.5404675687 -0.0340571177 -0.0521702678 [16] -0.1413483469 0.0640013511 0.0224056536 0.0583398645 -0.1324302553 [21] 0.0162592795 0.0180152121 0.0537079576 -0.0257248969 -0.1745333697 [26] 0.0334400190 -0.0395412537 -0.0420043659 -0.0229160819 -0.0006247833 [31] 0.0401854096 -0.0401829621 -0.0035851676 -0.0119172892 0.0234350864 [36] 0.0322592465 -0.0401006117 -0.0053454715 -0.0194236404 -0.0518575224 [41] -0.0402669474 0.0082367004 -0.0608532754 0.0086430705 0.0130947329 [46] 0.0123562895 0.0051264197 0.0097687608 -0.0243432051 0.0358068293 [51] 0.0419630549 -0.0311806551 0.0332951793 0.0245765894 0.0165148143 [56] -0.0001746271 -0.0347658675 -0.0836159516 0.0032197309 -0.0197144093 > 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/306oh1229448782.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/4xick1229448782.tab") > > system("convert tmp/16mpe1229448782.ps tmp/16mpe1229448782.png") > system("convert tmp/28zli1229448782.ps tmp/28zli1229448782.png") > > > proc.time() user system elapsed 0.584 0.322 0.719