R version 2.7.0 (2008-04-22) 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(20.72,21.45,22.09,21.53,23.35,23.57,26.42,25.21,26.44,29.34,29.40,33.05,28.38,26.01,29.31,30.36,35.75,36.15,34.21,37.91,38.70,42.12,42.16,39.80,37.36,38.35,42.60,41.25,42.16,46.94,47.43,47.06,50.18,50.13,43.23,40.04,40.37,42.21,37.00,39.74,42.68,46.29,46.97,48.73,52.37,50.05,54.04,57.78,64.72,63.41,64.36,66.03,72.14,76.60,86.97,93.48,95.59,81.89,70.55,50.38,36.25) > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '-0.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/1f6k71229940069.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/22l0o1229940069.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.341897552 0.146120299 0.049471953 -0.093238613 [6] -0.026311022 -0.165244003 -0.028655070 -0.073101815 -0.130185290 [11] 0.091029409 0.048537974 -0.065810092 -0.095790815 -0.065768230 [16] 0.081738487 -0.117485055 -0.106033497 -0.106216125 -0.155908040 [21] -0.064630250 0.064357259 0.137394788 0.070318529 0.065295401 [26] 0.184704498 0.138479601 -0.011952956 -0.044249102 -0.073773697 [31] -0.068834173 -0.059906715 0.009178392 0.037098680 -0.057238088 [36] 0.092288679 0.064865557 0.071723256 0.000921978 -0.031641639 [41] -0.026112345 -0.078479117 -0.001163764 -0.118669518 -0.084244177 [46] 0.001702823 0.041598387 0.141026946 0.033548123 -0.086625414 [51] -0.031203339 -0.091241397 -0.014436719 -0.044274327 -0.073371114 [56] -0.041022010 -0.037056862 0.002125099 -0.029173958 -0.016375320 > (mypacf <- c(rpacf$acf)) [1] 0.3418975516 0.0330949644 -0.0115037936 -0.1259270335 0.0472358334 [6] -0.1726681288 0.0975265242 -0.0983446375 -0.0773675349 0.1578212578 [11] 0.0038311491 -0.1727838686 -0.0479359649 0.0233429145 0.1082340278 [16] -0.1971344303 -0.0625456415 -0.0877112596 -0.0235121048 -0.0481421302 [21] 0.1265947075 0.0217641246 0.0132180415 0.0170536628 0.0977114814 [26] 0.0257565555 -0.0567038612 -0.0417990983 -0.0153423445 -0.0216230481 [31] 0.0003625378 -0.0156234192 0.0388858123 -0.0486292534 0.1468044673 [36] -0.1186739955 0.0975631978 -0.0307178156 0.0630448284 -0.1115157303 [41] 0.0691590756 0.0326118504 -0.1615358701 0.0308935833 0.0844120002 [46] -0.0064918109 0.0370714323 -0.0836670565 -0.1092683227 -0.0056153104 [51] 0.0267087003 -0.0499534377 0.0337059884 -0.0495531314 -0.0006831181 [56] -0.0309072321 -0.0936390279 -0.0103025109 0.0234197775 > 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/3nox01229940069.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/4hz9t1229940069.tab") > > system("convert tmp/1f6k71229940069.ps tmp/1f6k71229940069.png") > system("convert tmp/22l0o1229940069.ps tmp/22l0o1229940069.png") > > > proc.time() user system elapsed 2.626 0.721 2.739