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(159,158,157,155,175,174,159,149,150,150,151,153,146,156,154,151,171,167,144,138,138,132,132,132,125,131,129,131,145,156,126,123,127,116,114,114,109,110,113,114,138,155,126,123,124,124,134,131,126,128,128,124,148,174,146,137,152,159,170,166,165,168,175,180,199,228,206,193,201,214,225,224,215,222,238,248,262,288,261,240,248,260,266,268,256,261,287,295,304,331,299,275,293,309,311,311,289,298,319,325,331,348,320,305,322,337,346,343,321,331,343,345,347,363,322,304,323,340,352,351) > 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/1rqnh1282230198.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/2j0421282230198.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.970604699 0.946172912 0.924310090 0.895202232 [6] 0.865912165 0.836858873 0.804814708 0.775212350 0.751079212 [11] 0.723238541 0.696231944 0.664348065 0.630372670 0.591320732 [16] 0.547553261 0.511027902 0.466180813 0.417552626 0.363042079 [21] 0.313254374 0.264406950 0.214667964 0.169174858 0.124369668 [26] 0.082683482 0.041881550 0.005714277 -0.032329172 -0.066202744 [31] -0.102584381 -0.140326746 -0.176502789 -0.212851784 -0.248595199 [36] -0.282577902 -0.314639119 -0.343677795 -0.373451157 -0.396675682 [41] -0.415423884 -0.435632202 -0.446912235 -0.454357092 -0.465758436 [46] -0.470246035 -0.468421573 -0.474258207 -0.484009919 > (mypacf <- c(rpacf$acf)) [1] 0.970604699 0.070769495 0.039087716 -0.129164621 -0.037082245 [6] -0.024333295 -0.055686236 0.020508088 0.084291624 -0.049008243 [11] -0.010282711 -0.129522156 -0.064719239 -0.134958337 -0.118086757 [16] 0.103742734 -0.131199131 -0.090950376 -0.207244125 0.012550677 [21] -0.015602898 -0.057708346 0.047856618 0.006382456 0.017644415 [26] -0.030366558 0.023196935 -0.005833455 0.042797495 -0.043554734 [31] 0.010237938 -0.036035499 -0.023953895 -0.070365322 0.043485210 [36] -0.010453413 0.013708536 -0.101265973 0.052875516 0.028272134 [41] -0.091208455 0.132859302 0.027313213 -0.033910221 0.019215041 [46] 0.105070729 -0.105857209 -0.162793274 > 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/3nikq1282230198.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/4qj1v1282230198.tab") > > try(system("convert tmp/1rqnh1282230198.ps tmp/1rqnh1282230198.png",intern=TRUE)) character(0) > try(system("convert tmp/2j0421282230198.ps tmp/2j0421282230198.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.568 0.316 0.743