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(158,157,156,154,152,151,152,154,155,155,156,158,156,152,145,141,140,145,143,141,144,139,141,142,141,132,122,122,127,128,122,123,128,128,128,129,124,121,109,110,107,107,104,110,114,118,117,122,113,106,102,111,106,110,105,104,106,110,107,111,101,105,108,124,122,128,124,121,125,134,126,126,111,117,118,128,127,129,124,113,120,127,114,107) > 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/1seit1280409258.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/2seit1280409258.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.918001717 0.847521961 0.787323802 0.757195093 [6] 0.711604767 0.690209985 0.646882335 0.614916333 0.581369475 [11] 0.576634018 0.549977761 0.509335153 0.422663691 0.357104499 [16] 0.313752714 0.287793361 0.253431940 0.223010591 0.179351082 [21] 0.146280894 0.116924511 0.102921136 0.059150001 0.006071728 [26] -0.062588837 -0.107774898 -0.128527080 -0.138599434 -0.159638222 [31] -0.180526165 -0.202503209 -0.219553654 -0.230612534 -0.248812419 [36] -0.290447587 -0.328818470 -0.358229157 -0.379035643 -0.368825374 [41] -0.353181667 -0.338530519 -0.339325904 -0.332772118 -0.325132248 [46] -0.318189282 -0.326267465 -0.340189384 -0.358998682 -0.357962808 [51] -0.343930125 -0.308658462 -0.282000050 -0.260741890 -0.255560794 [56] -0.234592257 -0.203553306 -0.183173064 -0.179977089 -0.176506576 [61] -0.166691520 > (mypacf <- c(rpacf$acf)) [1] 0.9180017170 0.0304871976 0.0320107236 0.1666310757 -0.0877196035 [6] 0.1474965927 -0.1180941332 0.0365632890 0.0194805807 0.1191462348 [11] -0.0758637384 -0.1307268880 -0.2919794794 -0.0218507666 0.0976310543 [16] -0.0086294788 0.0153595729 -0.0360193092 -0.0424515096 -0.0009110982 [21] -0.0261443055 0.0326564284 -0.1069542737 -0.0461420662 -0.1123010300 [26] -0.0353122593 0.0811665872 -0.0068185125 0.0180803657 -0.0144637046 [31] 0.0147474813 -0.0497533029 0.0134563681 -0.0863681855 -0.0783243756 [36] 0.0307045067 -0.0401612006 -0.0798316019 0.1117191733 0.0413932189 [41] 0.1091862097 -0.0540094262 -0.0014161107 0.0057355160 -0.0210188233 [46] -0.0428118264 -0.0446293949 -0.0674825664 -0.0026553167 0.0342127445 [51] 0.0215666994 0.0207715568 0.0281246107 -0.0312083419 0.0630542882 [56] 0.1049011875 -0.0465703684 -0.0271406302 -0.0494072610 0.0234895319 > 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/3dehz1280409258.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/4hxfn1280409258.tab") > > try(system("convert tmp/1seit1280409258.ps tmp/1seit1280409258.png",intern=TRUE)) character(0) > try(system("convert tmp/2seit1280409258.ps tmp/2seit1280409258.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.607 0.314 0.833