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(89.3,88.1,93.6,79.7,83.8,62.3,62.3,77.6,80.3,97,94,75.1,74,77.6,75.1,85,75.4,63.2,64.7,77,82.6,97.6,99,75.3,71.6,76.8,83.9,79.7,77.5,73.1,65.6,85.2,98.3,98,100.6,84.1,76.7,82.4,95.5,79.9,82.4,83.6,73.1,91.1,118.6,102.9,111.8,93.9,91.6,92,91.1,97.5,94.7,96.7,78.7,103.5,113.8,106.1,120.3,114.2,106.3,98.8,113.1,97.7,116.3,107.2,94.5,123.5,126.6,126.5,141.4,124.3,124.9,108.9,126.7,107.7,121.8,118.3,122.8,149.5,147,139.3,162.1,142.2,141.4,124.7,114,126.6,121.9,125.1,122.1,135.9,148.4,137.5,145.3,139.9,128.2,115.4,124.7,111.5,121.1,122.5,127.4,143.7,157.8,148.8,162.9,153.9) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/1e1rm1289987751.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/2e1rm1289987751.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.244582452 -0.003056360 0.018155996 -0.294942231 [6] -0.014981493 0.143526913 -0.077463380 -0.160463443 -0.039574867 [11] -0.042795413 -0.017347909 0.550702901 -0.020566709 -0.075730881 [16] -0.004757706 -0.200287018 -0.089274538 0.120066538 -0.027821838 [21] -0.126452130 -0.060205972 0.005975295 -0.019332510 0.421542996 [26] -0.013298931 -0.027253902 -0.044983079 -0.133981299 -0.108667544 [31] 0.112903623 0.005289938 -0.115581059 -0.050871537 0.074302297 [36] -0.104986408 0.391276811 -0.039854907 -0.006936083 -0.032869095 [41] -0.115051610 -0.098821794 0.065074164 0.016601071 -0.072872706 [46] -0.020316124 0.032033473 -0.025944783 0.181443569 > (mypacf <- c(rpacf$acf)) [1] -0.244582452 -0.066877592 0.001069886 -0.309995795 -0.196570266 [6] 0.074914778 -0.045515496 -0.355281049 -0.325664423 -0.160411788 [11] -0.242397269 0.354170003 0.280649606 0.024134950 -0.061410407 [16] 0.079733826 -0.039537879 -0.134172684 -0.015144420 0.037400209 [21] -0.088944453 -0.021220470 -0.073830488 0.057783293 -0.085216059 [26] 0.003750731 -0.027161886 0.041451893 -0.030324557 0.020400363 [31] 0.051298433 0.004437541 -0.042765250 0.138282679 -0.092834423 [36] 0.041828353 -0.041771556 0.063597153 -0.038250503 0.045209952 [41] 0.009224752 -0.062949162 -0.061125665 0.047163653 0.049945383 [46] -0.063849894 0.048436993 -0.067645745 > 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/3zk7s1289987751.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/43k6g1289987751.tab") > > try(system("convert tmp/1e1rm1289987751.ps tmp/1e1rm1289987751.png",intern=TRUE)) character(0) > try(system("convert tmp/2e1rm1289987751.ps tmp/2e1rm1289987751.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.590 0.333 1.213