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(0,9,1,4,6,21,24,23,22,21,20,16,18,18,24,16,15,24,18,15,4,3,6,5,12,12,12,14,12,17,12,20,21,15,22,19,19,26,25,19,20,30,31,35,33,26,25,17,14,8,12,7,4,10,8,16,14,20,9,10) > par5 = '12' > par4 = '1' > 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/1gggm1229261264.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/2ykyr1229261264.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.156430748 0.097240214 0.091326169 -0.046953705 [6] 0.081791144 -0.114549105 -0.025499736 -0.065656866 0.040768830 [11] 0.160005109 -0.113962991 -0.315786210 0.107347258 -0.149315854 [16] -0.082290089 -0.091944375 -0.075192758 0.068023871 -0.032466313 [21] 0.063207462 -0.123777087 -0.183593416 0.124907247 -0.091520239 [26] -0.009105469 0.042684162 0.023827046 0.142971602 0.057809275 [31] 0.048226329 0.009893459 0.079273436 0.042357170 0.083150286 [36] -0.063241939 0.098013459 -0.045667855 0.011777999 -0.095907309 [41] -0.030206426 0.009027407 -0.096303690 0.128240267 -0.168587130 [46] 0.104753223 -0.038663115 > (mypacf <- c(rpacf$acf)) [1] -0.156430748 0.074595018 0.120679982 -0.024043968 0.053338674 [6] -0.103396460 -0.066306555 -0.077473250 0.058519311 0.202911284 [11] -0.046742669 -0.445391666 -0.053290393 -0.031317738 -0.047945163 [16] -0.083038002 -0.022125628 0.006430616 -0.090137240 -0.067457474 [21] -0.049671850 -0.186569448 -0.064706068 -0.131270895 0.024665313 [26] -0.005123060 -0.070934733 -0.043931019 0.020853914 -0.009447945 [31] -0.015051423 0.127698545 -0.055347363 -0.032780398 -0.071102116 [36] -0.013427624 -0.092397891 -0.086754846 -0.182637624 0.024872626 [41] 0.041278915 -0.091696287 0.085605468 -0.110032810 0.008522941 [46] -0.037007789 > 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/37ubh1229261264.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/4rktb1229261264.tab") > > system("convert tmp/1gggm1229261264.ps tmp/1gggm1229261264.png") > system("convert tmp/2ykyr1229261264.ps tmp/2ykyr1229261264.png") > > > proc.time() user system elapsed 0.599 0.326 0.693