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(65.1,72.5,70.6,81.9,72,70.9,71.1,65.1,78.1,92,77.8,63.3,56.2,79.2,69,66.1,77.5,69.3,70.2,70.2,78.2,85.4,82.4,61.2,52.2,85.3,79.9,72.2,85.7,75.5,69.2,77.6,85.3,77,89.9,60,54.3,84,69.9,75.1,81.7,69.9,68.3,77.3,77.4,85.3,91,60.6,57.6,93.8,78.7,80.3,89.8,77.5,71.7,83.2,86.2,100.7,100.8,57.1) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1.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/169ki1230120081.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/2yh1b1230120081.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.1231033301 -0.2661494108 0.0070331588 -0.1032365570 [6] 0.1116833061 0.3432328002 0.0471275924 -0.0865847450 -0.0452741056 [11] -0.3370019040 0.1063581495 0.6005275923 0.0000468261 -0.2400375275 [16] -0.0910662765 -0.1479191333 0.0647568209 0.2142317530 -0.0093382001 [21] -0.0930447831 -0.0677317445 -0.2762407606 0.1504898038 0.4204276262 [26] 0.0071146994 -0.1086023314 -0.1204554694 -0.0647781828 0.0692017658 [31] 0.1109841764 0.0142631489 -0.0550843746 -0.1193715445 -0.2138332046 [36] 0.0648853188 0.2381981307 0.0108340117 -0.1538306391 -0.1373261696 [41] -0.0353086619 -0.0064751740 0.0117019450 -0.0282506134 -0.0626896968 [46] -0.1248736454 -0.1062652454 0.0551898228 0.1066594612 0.0251716845 [51] -0.0952393733 -0.0884019219 -0.0225305355 -0.0143470508 0.0173836493 [56] -0.0010991743 -0.0605880071 -0.0350574135 -0.0295285544 0.0269555580 > (mypacf <- c(rpacf$acf)) [1] 0.123103330 -0.285632437 0.093220713 -0.218550574 0.231806317 [6] 0.213830580 0.070163881 0.036295321 -0.027491866 -0.379567267 [11] 0.212662355 0.387612623 -0.073419727 -0.094935249 -0.079961740 [16] -0.015623360 -0.078559468 -0.078142368 0.015681234 -0.066583247 [21] 0.088708155 -0.006512872 0.147441224 -0.002607142 0.095827815 [26] 0.056568080 -0.079791517 0.085512010 -0.128473409 -0.087357765 [31] 0.006083169 -0.054135681 -0.013913698 -0.055460427 -0.091809571 [36] 0.020422409 -0.038001935 -0.067728054 0.030188834 -0.001449004 [41] -0.013068931 -0.063281359 -0.066533789 -0.012559075 -0.050681287 [46] 0.109406980 -0.021615481 -0.057704573 -0.036783390 0.066211901 [51] -0.045076484 -0.137356477 0.010998732 -0.007529277 -0.007121131 [56] -0.019151266 0.107335103 -0.010326185 0.009791674 > 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/3y0on1230120081.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/4twcd1230120081.tab") > > system("convert tmp/169ki1230120081.ps tmp/169ki1230120081.png") > system("convert tmp/2yh1b1230120081.ps tmp/2yh1b1230120081.png") > > > proc.time() user system elapsed 0.604 0.319 0.760