R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(101.0,98.7,105.1,98.4,101.7,102.9,92.2,94.9,92.8,98.5,94.3,87.4,103.4,101.2,109.6,111.9,108.9,105.6,107.8,97.5,102.4,105.6,99.8,96.2,113.1,107.4,116.8,112.9,105.3,109.3,107.9,101.1,114.7,116.2,108.4,113.4,108.7,112.6,124.2,114.9,110.5,121.5,118.1,111.7,132.7,119.0,116.7,120.1,113.4,106.6,116.3,112.6,111.6,125.1,110.7,109.6,114.2,113.4,116.0,109.6,117.8,115.8,125.3,113.0,120.5,116.6,111.8,115.2,118.6,122.4,116.4,114.5,119.8,115.8,127.8,118.8,119.7,118.6,120.8,115.9,109.7,114.8,116.2,112.2) > par5 = '12' > par4 = '1' > 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: Write here your technical program description (don't use hard returns!) > 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 (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/1xwpw1229427383.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x,par1,main='Autocorrelation',xlab='lags',ylab='ACF') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2egns1229427383.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.3744492612 0.3225542711 0.2833449871 0.0395763767 [6] 0.0378254451 0.1328636568 0.0947858848 0.0470425410 0.2484526614 [11] -0.0529835200 0.0364988006 -0.2061247130 -0.2187225680 -0.0271907025 [16] -0.0960784474 -0.0573720913 0.0699403877 -0.0001242959 -0.0900292473 [21] 0.1691618808 -0.0520426819 -0.0108639067 0.1282728168 0.0337161802 [26] 0.0897302489 0.1896309252 0.1179988937 0.0829991425 0.1474765786 [31] -0.0294937981 0.0007886469 -0.0827635875 -0.1753288079 -0.1141046095 [36] -0.1332581737 -0.1848443494 -0.0723994384 -0.1660505712 -0.2161272855 [41] -0.0941366424 -0.1885476543 -0.0904741662 0.0021091913 -0.0044128325 [46] -0.0422627792 0.0138780514 -0.0814207263 -0.0947364948 -0.0299189215 [51] -0.0745808700 0.0053574489 0.0211209427 0.0460945308 0.0153864265 [56] -0.0245720938 -0.0472484269 -0.0484074280 -0.0586247554 -0.0507358135 [61] -0.0224216821 > (mypacf <- c(rpacf$acf)) [1] 0.374449261 0.212077948 0.132462442 -0.175357149 -0.029971516 [6] 0.161653241 0.081491724 -0.075987259 0.202788880 -0.240532001 [11] 0.057789367 -0.377605081 0.055333304 0.198442375 -0.024334962 [16] -0.098797661 0.118405833 -0.085008152 0.079071979 0.125157784 [21] 0.038864205 -0.028657540 0.004871356 -0.042103109 0.054737882 [26] 0.129365979 0.060384710 -0.070096193 -0.040528480 -0.083714339 [31] -0.092228237 -0.039383236 -0.062698086 -0.105144432 -0.020036081 [36] -0.112364117 0.052973006 -0.065032231 0.067839327 -0.036301170 [41] 0.015782576 0.123782712 0.023887064 0.012995580 -0.082240617 [46] -0.158279932 -0.001674708 -0.089525554 0.001242738 0.008984103 [51] -0.102663621 -0.003889827 0.027698554 0.037793856 0.036620097 [56] 0.067902684 -0.046732615 -0.008327513 0.023423592 0.012387252 > 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/3ih3v1229427383.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/4p5211229427383.tab") > > system("convert tmp/1xwpw1229427383.ps tmp/1xwpw1229427383.png") > system("convert tmp/2egns1229427383.ps tmp/2egns1229427383.png") > > > proc.time() user system elapsed 0.620 0.325 0.754