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(156.3,151.5,159.1,166.9,160.5,162.8,178.9,148.5,184.1,197,186.8,139.2,162.7,187.5,235.8,219.4,212.4,220.2,197.5,185.6,232.4,223.8,219.4,191.4,210.4,212.6,274.4,256,227.6,261.7,237,234.9,310.6,274.2,288.1,242.5,271.7,282.2,317.4,280.3,322.6,328.2,280.7,288.8,347.9,360.1,348,275.7,332.6,340.8,390.5,351.2,377.4,413.5,366.9,364.8,388,429.8,423.6,326.4) > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '0.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: 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/1v9wd1229088336.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/2712e1229088336.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.288576880 -0.311577097 0.330136164 -0.215562675 [6] 0.011257204 0.082681448 -0.208197873 0.077975523 0.106975175 [11] 0.053414942 -0.044530306 -0.186890515 0.107335949 0.067514981 [16] -0.145881421 -0.102288326 0.228550100 0.079571764 -0.144122660 [21] 0.022362821 0.105759743 -0.110518873 0.117231897 -0.069521259 [26] -0.177454508 0.214754591 -0.054137225 -0.014125155 0.004632272 [31] -0.110593024 0.163432760 0.005168664 -0.180228453 0.099113586 [36] 0.034107979 -0.057160633 0.012888473 0.042776349 -0.040892990 [41] 0.037624247 0.052249541 -0.090446667 -0.026835097 0.044629200 [46] -0.008448421 -0.014155315 > (mypacf <- c(rpacf$acf)) [1] -0.288576880 -0.430722854 0.103391790 -0.250486374 0.041620515 [6] -0.130532528 -0.157550776 -0.135186327 -0.014125874 0.194537726 [11] 0.029981271 -0.177679563 -0.093431550 -0.028287319 -0.053132441 [16] -0.290485189 0.128383029 0.119045851 -0.002825571 -0.139661812 [21] 0.195156471 0.053073674 0.163691420 -0.099663524 0.037246443 [26] 0.046448129 -0.184680690 0.017350474 0.010427634 -0.004419164 [31] -0.103978945 0.025427128 0.110968888 -0.051784479 -0.004202520 [36] -0.044846442 0.045586253 -0.026971461 -0.093292497 0.020830975 [41] 0.021413177 -0.010979544 -0.122591441 -0.007414523 -0.004787087 [46] 0.017440720 > 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/37f881229088336.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/4ibgu1229088336.tab") > > system("convert tmp/1v9wd1229088336.ps tmp/1v9wd1229088336.png") > system("convert tmp/2712e1229088336.ps tmp/2712e1229088336.png") > > > proc.time() user system elapsed 0.568 0.303 0.685