R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(27.00,26.88,27.38,26.82,27.00,26.15,25.85,26.17,25.66,25.72,25.42,25.10,26.20,26.39,26.27,26.63,21.10,20.30,20.61,21.05,20.45,20.91,21.22,20.85,21.90,22.71,22.40,22.81,23.96,23.37,23.55,23.01,22.63,22.63,22.00,22.15,22.00,22.00,21.84,22.10,22.37,21.83,21.77,21.89,20.76,20.21,20.19,20.01,19.16,18.50,17.41,18.14,18.60,18.32,18.40,18.16,17.29,16.65,16.36,16.32,17.37,17.30,18.10,19.00,18.38,18.41,18.10,17.87,18.70,18.81,18.88,19.44,18.60,18.80,18.62,18.24,17.84,17.85,17.67,17.99,18.15,18.39,18.07,18.39) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '48' > #'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/148ae1243860222.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/2s5ul1243860222.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.94238154 0.88172096 0.81977019 0.75805355 0.70388151 [7] 0.65750115 0.61092076 0.56393800 0.52353840 0.48726566 0.45144003 [13] 0.41319813 0.37551169 0.32983660 0.29070951 0.24326843 0.23098959 [19] 0.22600105 0.21630592 0.20732385 0.20765386 0.20234367 0.19461158 [25] 0.19259190 0.18085051 0.16170903 0.14528930 0.12675044 0.09336946 [31] 0.06548433 0.03548079 0.01105971 -0.01611496 -0.05141673 -0.08424285 [37] -0.11193983 -0.13322588 -0.15314317 -0.17386259 -0.19838797 -0.22845956 [43] -0.26232842 -0.29671650 -0.33070573 -0.35234524 -0.37126510 -0.38306913 [49] -0.38903215 > (mypacf <- c(rpacf$acf)) [1] 0.942381538 -0.056845741 -0.043127516 -0.031399099 0.032715326 [6] 0.034762796 -0.035319886 -0.034798174 0.033061722 0.015247934 [11] -0.021892269 -0.051146218 -0.015532376 -0.087655537 0.033862808 [16] -0.111683724 0.292580792 0.022458724 -0.066555567 -0.019427603 [21] 0.111931564 -0.035726178 -0.039398768 0.025559788 -0.053446702 [26] -0.052218535 0.013321291 -0.061134347 -0.133128177 -0.025446832 [31] -0.013185174 -0.015505167 0.011148649 -0.104348143 -0.013326862 [36] 0.008732967 0.092696353 -0.042466360 -0.078771856 -0.013791193 [41] -0.078428567 -0.117019621 -0.045238378 -0.007954039 -0.036047630 [46] -0.033535186 0.058785773 0.011259759 > 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/3s8bx1243860222.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/4vegt1243860222.tab") > > system("convert tmp/148ae1243860222.ps tmp/148ae1243860222.png") > system("convert tmp/2s5ul1243860222.ps tmp/2s5ul1243860222.png") > > > proc.time() user system elapsed 0.576 0.308 0.786