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(278.1,283.3,287,287.9,279.7,273.2,272.6,274.8,277.2,277.5,278.7,279,280.1,280.8,280.1,270.5,260,258.2,260.1,262.2,263.4,264.7,267.4,266.8,265.2,262.5,255,252.8,249.6,254.2,259.4,260.8,261.6,257.2,249.8,235.2,227.4,223.1,221.6,218.5,220.1,222.1,222.9,222.8,222.1,209,201.7,204.5,208.7,213,218.6,221.9,224.6,226.8,229.6,231.4,229.1,232.7,236.6,242.2,251.5,261.5,266.4,280.9,294.4,308.8,328.8,348.2,365.9,387.5,395.9,395.8) > 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/1lkit1275816799.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/2lkit1275816799.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.91167566 0.79832425 0.67556445 0.56250041 0.45985806 [7] 0.37134529 0.29706693 0.23139063 0.17310334 0.12249009 0.06815825 [13] 0.01659610 -0.02938053 -0.06985567 -0.10421671 -0.13142032 -0.15907398 [19] -0.18581993 -0.21163386 -0.23876127 -0.26545564 -0.28863242 -0.30399457 [25] -0.31037537 -0.30610320 -0.29316677 -0.28272356 -0.28223103 -0.27901500 [31] -0.27465591 -0.26830168 -0.25627522 -0.23670278 -0.21335332 -0.18473283 [37] -0.15496958 -0.13088504 -0.12103372 -0.11822208 -0.11958344 -0.12043581 [43] -0.11964085 -0.11151636 -0.09545274 -0.07997563 -0.06353863 -0.05365853 [49] -0.04676022 > (mypacf <- c(rpacf$acf)) [1] 0.9116756605 -0.1944255343 -0.1015647113 -0.0017678156 -0.0220165877 [6] -0.0029550728 0.0013962036 -0.0285377649 -0.0215614744 -0.0105132896 [11] -0.0795989482 -0.0258277052 -0.0125343538 -0.0267304730 -0.0193272326 [16] -0.0117761304 -0.0599582787 -0.0374500451 -0.0354366864 -0.0580773865 [21] -0.0410832699 -0.0289037198 -0.0131732329 -0.0066945026 0.0056654977 [26] -0.0031507343 -0.0558246979 -0.0846951787 0.0045308358 -0.0207694272 [31] -0.0251233476 0.0007404082 0.0059003711 -0.0148512216 0.0087281171 [36] -0.0122886655 -0.0417490508 -0.0759026116 -0.0376194295 -0.0348293174 [41] -0.0213904527 -0.0298757239 0.0010898596 0.0115506017 -0.0441668078 [46] -0.0136552624 -0.0485717524 -0.0210404360 > 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/3htg21275816799.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/42cf81275816799.tab") > > try(system("convert tmp/1lkit1275816799.ps tmp/1lkit1275816799.png",intern=TRUE)) character(0) > try(system("convert tmp/2lkit1275816799.ps tmp/2lkit1275816799.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.582 0.318 0.728