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(101.3,91.5,152.6,86.6,86.6,98.5,86.7,89.1,111,92.6,85.1,116.1,98.3,97.7,177.9,94.2,83.8,109.5,102.3,102.5,116.4,85.3,88.2,104.7,99.4,113.8,166.6,89.2,93.2,115,97.2,112.5,121.8,100.2,93.8,113.6,110.7,127.6,185.9,105.9,108,125.2,106.2,123.3,145.2,114.3,108.4,120.9,126.3,141.3,208.2,131.6,119.8,122.5,137.6,141,154.1,127,106.1,129.9) > 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/1uydc1229579049.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/27mie1229579049.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.2358700521 0.0201132777 0.2869376682 0.2548937969 [6] 0.2596626266 0.2562759961 0.0762312280 0.0373568304 -0.0413023014 [11] 0.0866061860 0.2055889636 -0.1104886800 -0.0572004285 -0.0046493083 [16] -0.0346755680 -0.1070738892 -0.0880774946 -0.0915411551 -0.0392013619 [21] -0.1510358361 -0.1372126669 -0.1486381040 -0.1139983814 -0.1904232519 [26] -0.1776389268 0.0200285843 -0.1580037962 -0.2970694478 -0.0713255004 [31] -0.0112359969 -0.0810240248 0.0304626546 -0.1182570656 -0.0778593706 [36] 0.0165013894 0.0556315163 0.1368400744 -0.0809891147 -0.1341201051 [41] 0.0666597982 0.0357929615 -0.0403262044 -0.0056668670 -0.0450496225 [46] -0.0024705966 0.0341476559 0.0009538066 > (mypacf <- c(rpacf$acf)) [1] 0.235870052 -0.037614049 0.308460360 0.129915652 0.234351426 [6] 0.135092192 -0.063040169 -0.099917251 -0.276362928 -0.006617048 [11] 0.120476028 -0.121930131 0.108495438 -0.064976659 0.046189588 [16] -0.204000002 -0.076841756 -0.053975787 0.087082916 -0.015184661 [21] -0.033080453 -0.107135382 0.031255105 -0.243548660 -0.055154052 [26] 0.189665781 0.028445691 -0.119245441 0.005115714 -0.009557532 [31] 0.062017654 0.093267739 -0.064162382 0.013773116 0.076250179 [36] -0.048791575 0.019180358 -0.150695721 -0.022433551 -0.114245561 [41] -0.025511100 -0.076575476 -0.004340183 0.065194015 -0.010735914 [46] 0.062879187 0.004145998 > 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/391ih1229579049.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/48dd31229579049.tab") > > system("convert tmp/1uydc1229579049.ps tmp/1uydc1229579049.png") > system("convert tmp/27mie1229579049.ps tmp/27mie1229579049.png") > > > proc.time() user system elapsed 1.552 0.546 1.640