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(25,24,23,21,41,40,25,15,16,16,17,19,18,19,20,21,46,47,30,16,15,18,30,31,32,36,30,31,61,57,45,33,31,36,46,49,34,40,41,48,75,77,71,54,50,56,66,66,48,63,71,70,88,92,91,80,81,81,98,106,85,93,96,92,115,109,119,107,107,106,132,143,120,123,132,136,158,151,155,138,143,139,168,182,154,158,167,170,197,190,196,174,180,171,200,215,184,186,197,186,211,205,218,199,213,207,236,248,211,220,235,223,245,236,253,246,255,248,274,288) > 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/1nv4j1282244398.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/2nv4j1282244398.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.879661276 0.766655038 0.688271114 0.639826517 [6] 0.596005293 0.565206352 0.539872000 0.518319806 0.469199587 [11] 0.427961623 0.412112474 0.396475285 0.379851157 0.379581056 [16] 0.374548481 0.372576077 0.367642859 0.318807461 0.296731992 [21] 0.295137141 0.292740817 0.260471405 0.230215610 0.243729522 [26] 0.232848181 0.213475199 0.198387781 0.181757029 0.153786427 [31] 0.126895495 0.136262942 0.137416946 0.128681698 0.111726383 [36] 0.077960004 0.044716901 -0.008430555 -0.031214765 -0.036459299 [41] -0.064224566 -0.097639886 -0.117529520 -0.136995234 -0.146869765 [46] -0.149988077 -0.167579272 -0.162245685 -0.149327911 > (mypacf <- c(rpacf$acf)) [1] 0.8796612764 -0.0316049872 0.0901081502 0.0934282740 0.0163331181 [6] 0.0678010177 0.0350352977 0.0329625440 -0.1045644631 0.0231816423 [11] 0.0790169644 -0.0133518448 0.0202871961 0.0820501837 -0.0065507059 [16] 0.0461358635 0.0281304540 -0.1905657296 0.0912313862 0.0552060483 [21] -0.0117203253 -0.1209860602 0.0024513866 0.1818772838 -0.1414120753 [26] 0.0457205279 -0.0034335656 -0.0940940485 -0.0172271416 0.0100048379 [31] 0.1076078271 -0.1046585039 0.0310705207 0.0016134739 -0.1384412079 [36] -0.0208264606 -0.1423930804 0.0632871432 0.0499222881 -0.1594775240 [41] -0.0923049441 0.0916437492 -0.0029668034 -0.0004784028 -0.0168624235 [46] -0.0590241534 0.1091966339 -0.0588405626 > 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/38v3p1282244398.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/4twjv1282244398.tab") > > try(system("convert tmp/1nv4j1282244398.ps tmp/1nv4j1282244398.png",intern=TRUE)) character(0) > try(system("convert tmp/2nv4j1282244398.ps tmp/2nv4j1282244398.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.562 0.316 0.728