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(1.43,1.43,1.43,1.43,1.43,1.43,1.44,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.57,1.58,1.58,1.58,1.58,1.59,1.6,1.6,1.61,1.61,1.61,1.62,1.63,1.63,1.64,1.64,1.64,1.64,1.64,1.65,1.65,1.65,1.65) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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: > 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 (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > 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/16szb1259329377.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2thv31259329377.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.9112466269 0.8102222696 0.7173785684 0.6221914501 [6] 0.5334380770 0.4249573924 0.3093186337 0.2112341997 0.0947432893 [11] -0.0214493680 -0.1369176963 -0.2476139753 -0.2813183497 -0.3068420679 [16] -0.3415690243 -0.3759977276 -0.4094038489 -0.4333084789 -0.4129438290 [21] -0.3874662690 -0.3517628888 -0.3160595086 -0.2810804573 -0.2485300383 [26] -0.2108667093 -0.1748650760 -0.1350713677 -0.0942550774 -0.0534387871 [31] -0.0085321687 0.0043761540 0.0047152393 0.0081220707 0.0122532311 [36] 0.0163843914 0.0164252237 0.0110548928 0.0111383326 0.0084522795 [41] 0.0044453913 0.0004385031 -0.0006710695 -0.0007580599 -0.0005467973 [46] -0.0006337878 -0.0004225252 -0.0002112626 > (mypacf <- c(rpacf$acf)) [1] 0.9112466269 -0.1187773081 -0.0023503799 -0.0749032557 -0.0152903935 [6] -0.1840409290 -0.0993056219 0.0110011246 -0.2085448252 -0.0888015226 [11] -0.1235314844 -0.0840525600 0.3337484263 -0.0647052645 -0.0684892206 [16] -0.0999232742 -0.0482250267 -0.1211886745 0.1921670209 0.0234610390 [21] -0.0640875253 -0.0697848573 -0.0527263535 -0.1139526286 0.2184029478 [26] -0.0097400671 -0.0905996577 -0.0675645590 -0.0310031988 -0.0266508238 [31] 0.0197894741 -0.0084734087 -0.0616633507 -0.0806033609 -0.0387916596 [36] -0.0971438380 0.1981277652 0.0308465297 -0.0511986313 -0.0682369217 [41] -0.0209602876 -0.0006648207 0.0079920822 0.0064605816 -0.0273997163 [46] -0.0666918138 -0.0253550021 > 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/3ys9n1259329377.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/4l0ax1259329377.tab") > > system("convert tmp/16szb1259329377.ps tmp/16szb1259329377.png") > system("convert tmp/2thv31259329377.ps tmp/2thv31259329377.png") > > > proc.time() user system elapsed 0.560 0.320 0.669