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(595,591,589,584,573,567,569,621,629,628,612,595,597,593,590,580,574,573,573,620,626,620,588,566,557,561,549,532,526,511,499,555,565,542,527,510,514,517,508,493,490,469,478,528,534,518,506,502,516,528,533,536,537,524,536,587,597,581,564,564) > par7 = '' > par6 = 'White Noise' > 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/1qofp1259795535.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/2dyig1259795535.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.000000e+00 8.883792e-01 7.256523e-01 6.170964e-01 5.741039e-01 [6] 5.747273e-01 5.638288e-01 5.076405e-01 4.120239e-01 3.509074e-01 [11] 3.475687e-01 3.980849e-01 4.073333e-01 2.657951e-01 9.623321e-02 [16] -2.024837e-02 -7.504460e-02 -8.989074e-02 -1.113498e-01 -1.635979e-01 [21] -2.470065e-01 -2.948863e-01 -2.911037e-01 -2.399637e-01 -2.180382e-01 [26] -2.972304e-01 -3.922276e-01 -4.366632e-01 -4.334507e-01 -4.046101e-01 [31] -3.738919e-01 -3.583047e-01 -3.719097e-01 -3.613747e-01 -3.103255e-01 [36] -2.388319e-01 -1.907684e-01 -2.080475e-01 -2.375349e-01 -2.416014e-01 [41] -2.123580e-01 -1.717720e-01 -1.251526e-01 -9.193170e-02 -8.492205e-02 [46] -7.213551e-02 -4.183498e-02 3.099386e-05 2.900428e-02 > (mypacf <- c(rpacf$acf)) [1] 0.888379248 -0.301568911 0.239763351 0.127100129 0.141148586 [6] -0.046667360 -0.094483462 -0.120981368 0.160101627 0.065266244 [11] 0.205192792 -0.245508190 -0.592491905 0.130871258 -0.035321623 [16] -0.079586917 -0.080304977 -0.136261758 0.131307940 0.028824453 [21] -0.009176467 -0.049762396 -0.002674969 0.072116018 0.019314588 [26] -0.062302960 0.053208194 -0.088510090 0.016414407 0.072330362 [31] 0.047240618 -0.047019751 -0.014354416 0.018836430 -0.080224077 [36] 0.064630857 -0.001501650 -0.084770372 -0.101492625 0.054272156 [41] -0.018085152 0.050390262 -0.126568997 0.014622105 -0.067767175 [46] -0.026934645 0.075072977 -0.063564231 > 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 1:par1) { + 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(mytstat,lengthx),6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/34k851259795535.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-1,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(mytstat,lengthx),6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/4bkt61259795535.tab") > system("convert tmp/1qofp1259795535.ps tmp/1qofp1259795535.png") > system("convert tmp/2dyig1259795535.ps tmp/2dyig1259795535.png") > > > proc.time() user system elapsed 0.578 0.299 0.680