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.4,1.2,1,1.7,2.4,2,2.1,2,1.8,2.7,2.3,1.9,2,2.3,2.8,2.4,2.3,2.7,2.7,2.9,3,2.2,2.3,2.8,2.8,2.8,2.2,2.6,2.8,2.5,2.4,2.3,1.9,1.7,2,2.1,1.7,1.8,1.8,1.8,1.3,1.3,1.3,1.2,1.4,2.2,2.9,3.1,3.5,3.6,4.4,4.1,5.1,5.8,5.9,5.4,5.5,4.8,3.2,2.7,2.1,1.9,0.6,0.7,-0.2,-1,-1.7,-0.7,-1) > par7 = '0.95' > par6 = 'White Noise' > 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: > 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/1l1kn1259323560.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/2fff91259323560.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.898914100 0.781736046 0.623569959 0.462613324 [6] 0.289744355 0.129927944 -0.039550361 -0.187640473 -0.329312328 [11] -0.430032156 -0.511026118 -0.564006589 -0.545723092 -0.500065230 [16] -0.429682522 -0.364070749 -0.293324970 -0.228028259 -0.150897228 [21] -0.091292632 -0.020921927 0.034754899 0.075950886 0.110338539 [26] 0.130191344 0.131986609 0.125698289 0.128885827 0.128253616 [31] 0.129943860 0.124606727 0.123560435 0.110979882 0.094717608 [36] 0.077741194 0.062307082 0.036821000 0.021281867 0.010285625 [41] -0.002033877 -0.014467401 -0.030189569 -0.051246784 -0.065945751 [46] -0.086051779 -0.094521526 -0.103222319 -0.120147723 -0.112441299 [51] -0.105494025 -0.106003211 -0.101369390 -0.093494934 -0.077917968 [56] -0.050875754 -0.029786708 -0.007569440 0.009981913 0.024916753 [61] 0.051388855 > (mypacf <- c(rpacf$acf)) [1] 0.8989141002 -0.1370671614 -0.2774183136 -0.0930851882 -0.1420655160 [6] -0.0593900208 -0.1904392100 -0.0750699281 -0.1332222526 0.0012448629 [11] -0.0803937220 -0.1032833976 0.2402734371 -0.0128135273 -0.0397758592 [16] -0.1579923246 -0.0676740187 -0.0518218527 -0.0135355847 -0.1089885010 [21] 0.0012967860 0.0397485062 -0.1094670770 0.0158077974 -0.0024312903 [26] -0.0363890585 -0.0387283272 0.0427067751 -0.0399835966 -0.0063278347 [31] 0.0123138254 -0.0270404288 0.0076078695 -0.0536489477 -0.0154697469 [36] 0.0004684927 -0.0548212206 0.0037546194 0.0431851302 0.0094782991 [41] -0.0116359251 -0.0089533494 -0.0836746287 0.0281328187 -0.0698514578 [46] -0.0120531689 -0.0325853013 -0.0895565583 0.1099585125 -0.0269731946 [51] -0.0831349054 -0.0145036496 0.0134147096 -0.0185559128 0.0027395949 [56] -0.0459345365 -0.0766300118 0.0429298975 -0.0465903069 0.0222629355 > 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/34t931259323560.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/4bq3u1259323560.tab") > > system("convert tmp/1l1kn1259323560.ps tmp/1l1kn1259323560.png") > system("convert tmp/2fff91259323560.ps tmp/2fff91259323560.png") > > > proc.time() user system elapsed 0.591 0.319 0.687