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(93.0,99.2,112.2,112.1,103.3,108.2,90.4,72.8,111.0,117.9,111.3,110.5,94.8,100.4,132.1,114.6,101.9,130.2,84.0,86.4,122.3,120.9,110.2,112.6,102.0,105.0,130.5,115.5,103.7,130.9,89.1,93.8,123.8,111.9,118.3,116.9,103.6,116.6,141.3,107.0,125.2,136.4,91.6,95.3,132.3,130.6,131.9,118.6,114.3,111.3,126.5,112.1,119.3,142.4,101.1,97.4,129.1,136.9,129.8,123.9) > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '2.0' > 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/16onc1229685688.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/2i1331229685688.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.104715639 -0.030556302 0.241063230 -0.184291224 [6] -0.117873670 0.151225677 -0.063778401 0.068329084 -0.097082868 [11] -0.079416328 0.036922903 -0.312466325 -0.087021661 -0.011363435 [16] -0.095535164 -0.100468525 0.208928182 -0.121670155 -0.120692673 [21] 0.069111467 0.124727797 -0.156826597 0.206846522 0.060261054 [26] -0.039574791 0.126937847 0.036954803 0.070228018 0.047285219 [31] -0.060765987 0.107666135 0.011830042 -0.164528554 0.129825694 [36] -0.118329130 -0.105356389 0.059802700 -0.052152585 -0.036119588 [41] 0.085674577 -0.067095354 -0.026194199 0.029468490 -0.034470202 [46] 0.012266203 0.004296553 -0.001306452 > (mypacf <- c(rpacf$acf)) [1] -0.104715639 -0.041982015 0.236336492 -0.146035981 -0.146702807 [6] 0.079221943 0.033312786 0.104890399 -0.202581185 -0.088682895 [11] 0.031534301 -0.272662474 -0.156385943 -0.155323656 0.044463496 [16] -0.189867367 0.105051185 -0.106068275 -0.163696482 -0.042865040 [21] 0.147882919 -0.150536307 0.029556510 -0.094976727 -0.013382177 [26] 0.024085035 -0.013670793 0.021714380 0.028209293 -0.044032599 [31] 0.026567426 -0.016457876 -0.007931468 -0.076826306 -0.012505634 [36] -0.011502366 0.002294526 -0.079558263 0.132016253 0.088002566 [41] 0.043550231 -0.072679253 0.113667187 -0.002252250 0.025191844 [46] -0.054278614 0.008517210 > 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/392m81229685688.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/465je1229685688.tab") > > system("convert tmp/16onc1229685688.ps tmp/16onc1229685688.png") > system("convert tmp/2i1331229685688.ps tmp/2i1331229685688.png") > > > proc.time() user system elapsed 1.558 0.552 1.641