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(115.47,103.34,102.6,100.69,105.67,123.61,113.08,106.46,123.38,109.87,95.74,123.06,123.39,120.28,115.33,110.4,114.49,132.03,123.16,118.82,128.32,112.24,104.53,132.57,122.52,131.8,124.55,120.96,122.6,145.52,118.57,134.25,136.7,121.37,111.63,134.42,137.65,137.86,119.77,130.69,128.28,147.45,128.42,136.9,143.95,135.64,122.48,136.83,153.04,142.71,123.46,144.37,146.15,147.61,158.51,147.4,165.05,154.64,126.2,157.36,154.15,123.21,113.07,110.45,113.57,122.44,114.93,111.85,126.04,121.34) > 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/16um21259073010.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/23i7g1259073010.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.596316325 0.436256073 0.525281935 0.463183949 [6] 0.367690325 0.375728593 0.217571911 0.273182694 0.157750886 [11] 0.018078168 0.136820002 0.325975701 0.092110350 0.008605115 [16] 0.072084685 0.102549777 0.037678704 0.064874839 0.030799103 [21] 0.045037615 -0.048472506 -0.119893445 -0.041924263 0.066134723 [26] -0.059899637 -0.170555198 -0.094148493 -0.035859751 -0.120849143 [31] -0.101054051 -0.078576284 -0.149228974 -0.171955367 -0.205008594 [36] -0.213933090 -0.108038418 -0.179221607 -0.285478219 -0.190874819 [41] -0.168067107 -0.226482232 -0.184080116 -0.162985740 -0.226735366 [46] -0.213126767 -0.228207544 -0.220578333 -0.142101472 -0.195515310 [51] -0.247249299 -0.165884765 -0.160119334 -0.176093109 -0.115758776 [56] -0.098945150 -0.081994062 -0.028203980 -0.021611185 0.021257799 [61] 0.082296097 > (mypacf <- c(rpacf$acf)) [1] 0.596316325 0.125173894 0.351650869 0.050383619 0.019417738 [6] 0.059989044 -0.235185822 0.196602391 -0.295153797 -0.050072323 [11] 0.181362830 0.368209214 -0.204384796 -0.167112843 -0.010345145 [16] 0.043380282 -0.068777867 0.050295796 0.048352794 -0.108391125 [21] -0.029590100 -0.009916773 0.015732472 -0.062424076 0.075531940 [26] -0.151311415 0.078572206 0.018813510 -0.032219972 -0.052608184 [31] -0.046698681 -0.133262104 0.038323607 0.004298971 -0.115622398 [36] 0.027051820 -0.006108067 0.071693813 -0.097601090 0.010961395 [41] -0.049645312 -0.052977025 -0.005191279 -0.064373185 -0.005358797 [46] -0.038344189 0.035155978 -0.021066195 -0.060976797 0.055569311 [51] -0.025899950 -0.037202279 0.018309311 0.030742971 -0.005543682 [56] 0.098566868 0.099479342 -0.021740688 0.004351927 0.037146452 > 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/3riyb1259073010.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/4qvmr1259073010.tab") > > system("convert tmp/16um21259073010.ps tmp/16um21259073010.png") > system("convert tmp/23i7g1259073010.ps tmp/23i7g1259073010.png") > > > proc.time() user system elapsed 0.609 0.315 0.754