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(62.7,62.3,61.9,62,62.3,62.8,62.4,62.3,62.7,62.7,62.9,63,62.2,62.3,62.8,62.8,62.8,62.2,62.6,62.8,62.5,62.4,62.3,61.9,61.7,62,62.1,61.7,61.8,61.8,61.8,61.3,61.3,61.3,61.2,61.4,62.2,62.9,63.1,63.5,63.6,64.4,64.1,65.1,65.8,65.9,65.4,65.5,64.8,63.2,62.7,62.1,61.9,60.6,60.7,59.8,59,58.3,59.3,59,59.1) > 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/1o11r1260458685.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/2nmga1260458685.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.0000000000 0.9132663200 0.8017272688 0.6749085530 0.5070523396 [6] 0.3191530640 0.1494800977 -0.0071403319 -0.1770560398 -0.3168957250 [11] -0.4301600928 -0.5143466178 -0.5918474051 -0.5894742004 -0.5427511080 [16] -0.4837135008 -0.4151425672 -0.3256631918 -0.2430556924 -0.1795507671 [21] -0.1065125154 -0.0373428915 0.0296866867 0.0735044984 0.1155501869 [26] 0.1498248755 0.1554429816 0.1478398291 0.1475842392 0.1422234540 [31] 0.1271682403 0.1171311397 0.1138951607 0.1028903589 0.0773362947 [36] 0.0601715141 0.0506503757 0.0232392831 -0.0005840219 -0.0133391764 [41] -0.0265210338 -0.0426092604 -0.0458648328 -0.0456392934 -0.0547968636 [46] -0.0552233523 -0.0515918095 -0.0391671392 -0.0439705982 -0.0483702134 [51] -0.0328443274 -0.0220121732 -0.0138969844 -0.0017466231 0.0009781761 [56] 0.0007966060 0.0070841567 0.0055702287 0.0012576957 -0.0082982756 [61] -0.0082849991 > (mypacf <- c(rpacf$acf)) [1] 0.9132663200 -0.1948125873 -0.1378425724 -0.3179007186 -0.2076187357 [6] 0.0066625120 -0.0206827332 -0.2382878109 -0.0387320268 -0.0957637319 [11] 0.0241355696 -0.2095204148 0.3032737190 0.0589736479 -0.0048940388 [16] -0.2504125458 -0.0443702006 -0.1300439680 -0.0009522932 -0.0969386878 [21] 0.0524542641 0.0217413556 -0.0538086531 -0.1525230753 0.1497518474 [26] -0.0582174697 0.0417361265 -0.0900834546 0.0504851875 -0.0869365035 [31] -0.0377494034 -0.0242638171 0.0720221899 -0.0762142715 0.0124785501 [36] -0.0329023329 -0.0299569494 -0.0503077403 -0.0377182669 0.0438178874 [41] 0.0652149855 0.0209435176 -0.0897132789 -0.0202902772 0.0238547483 [46] -0.0388282759 0.0291912537 -0.0863159203 -0.0716888303 0.0900638406 [51] -0.0253906303 0.0815526530 -0.0511156239 -0.0740002734 0.0314011713 [56] 0.0297726823 -0.0782710125 -0.0596989800 -0.0160275658 0.0735620804 > 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/38fik1260458685.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/41ct01260458685.tab") > > system("convert tmp/1o11r1260458685.ps tmp/1o11r1260458685.png") > system("convert tmp/2nmga1260458685.ps tmp/2nmga1260458685.png") > > > proc.time() user system elapsed 0.584 0.300 1.095