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(699.8,871.2,842.6,809.2,847.1,857,839.9,967.4,1037.2,1062.3,899.3,1129.6,845.7,1173.9,1073.8,1024.7,912.9,1055,936.4,920.6,1059.3,1164.1,823.9,1076.6,833.5,996,852.8,758.5,760.4,826.8,941.7,1097.8,802.8,839.7,791,1063.1,1138.4,888.6,931.1,863.2,936.2,701.7,873.8,696.8,658.1,706.7,458.5,685.7,660.1,774.9,787.4,486.9,310.8,619.5,550.2,463.4,630.4,729,485.6,453.7) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '36' > #'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/13ikz1259311117.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/2110k1259311117.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.347994722 -0.107331743 -0.123734485 0.173827959 [6] 0.022782285 -0.026843717 -0.134480377 0.054961979 0.087299041 [11] -0.106180461 0.174392093 -0.342497540 0.084789763 0.084334779 [16] 0.026644331 -0.140403651 0.020178928 0.038886879 0.151073185 [21] -0.113550259 -0.038316335 0.121854806 0.028059831 -0.155472319 [26] 0.076062714 -0.005932253 0.104959953 -0.080240541 0.037128489 [31] -0.037709090 -0.102834085 0.102495385 -0.004888308 -0.045482524 [36] -0.029346775 0.102632049 > (mypacf <- c(rpacf$acf)) [1] -0.347994722 -0.259906877 -0.318767807 -0.060441444 0.007737125 [6] 0.016878701 -0.107061160 -0.070386422 0.019073220 -0.123767976 [11] 0.183237895 -0.282422063 -0.221661001 -0.096028349 -0.158660226 [16] -0.182568035 -0.173730702 -0.137564146 -0.023763098 -0.099609707 [21] -0.010207515 0.028944112 0.151470342 -0.198098600 -0.096961311 [26] -0.110029196 -0.012889842 -0.097033007 0.046452329 -0.003708260 [31] -0.167168296 0.016040942 -0.022508235 -0.040613277 0.126404548 [36] -0.001108720 > 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/3su7q1259311117.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/4h74c1259311117.tab") > > system("convert tmp/13ikz1259311117.ps tmp/13ikz1259311117.png") > system("convert tmp/2110k1259311117.ps tmp/2110k1259311117.png") > > > proc.time() user system elapsed 0.545 0.323 1.242