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(75.9,76.9,77.9,78.9,79.9,80.9,81.9,82.9,83.9,84.9,85.9,86.9,87.9,88.9,89.9,90.9,91.9,92.9,93.9,94.9,95.9,96.9,97.9,98.9,99.9,100.9,101.9,102.9,103.9,104.9,105.9,106.9,107.9,108.9,109.9,110.9,111.9,112.9,113.9,114.9,115.9,116.9,117.9,118.9,119.9,120.9,121.9,122.9,123.9,124.9,125.9,126.9,127.9,128.9,129.9,130.9,131.9,132.9,133.9,134.9,135.9,136.9,137.9,138.9,139.9,140.9,141.9,142.9,143.9,144.9,145.9,146.9) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > 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/1sm8t1290535740.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/2ld8v1290535740.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.00000000 0.95833333 0.91669882 0.87512863 0.83365490 0.79230979 [7] 0.75112547 0.71013409 0.66936781 0.62885877 0.58863914 0.54874108 [13] 0.50919673 0.47003827 0.43129783 0.39300759 0.35519969 0.31790630 [19] 0.28115956 0.24499164 0.20943469 0.17452087 0.14028233 0.10675124 [25] 0.07395974 0.04194000 0.01072416 -0.01965560 -0.04916715 -0.07777831 [31] -0.10545694 -0.13217088 -0.15788797 -0.18257605 -0.20620297 -0.22873657 [37] -0.25014470 -0.27039520 -0.28945591 -0.30729468 -0.32387935 -0.33917776 [43] -0.35315776 -0.36578719 -0.37703389 -0.38686571 -0.39525050 -0.40215609 [49] -0.40755032 > (mypacf <- c(rpacf$acf)) [1] 0.95833333 -0.02088251 -0.02093333 -0.02098540 -0.02103833 -0.02109171 [7] -0.02114507 -0.02119796 -0.02124988 -0.02130030 -0.02134866 -0.02139436 [13] -0.02143678 -0.02147522 -0.02150896 -0.02153723 -0.02155918 -0.02157394 [19] -0.02158054 -0.02157796 -0.02156510 -0.02154078 -0.02150374 -0.02145262 [25] -0.02138597 -0.02130224 -0.02119977 -0.02107678 -0.02093136 -0.02076150 [31] -0.02056503 -0.02033967 -0.02008296 -0.01979233 -0.01946504 -0.01909820 [37] -0.01868877 -0.01823356 -0.01772923 -0.01717229 -0.01655911 -0.01588594 [43] -0.01514891 -0.01434405 -0.01346730 -0.01251453 -0.01148158 -0.01036424 > 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/36e611290535740.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/49enp1290535740.tab") > > try(system("convert tmp/1sm8t1290535740.ps tmp/1sm8t1290535740.png",intern=TRUE)) character(0) > try(system("convert tmp/2ld8v1290535740.ps tmp/2ld8v1290535740.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.573 0.314 1.254