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.73,101.63,101.43,101.34,101.01,100.89,100.93,100.77,100.3,99.86,99.71,99.93,99.88,99.92,99.87,99.63,100.05,99.88,100.11,100.05,100.07,100.2,100.21,99.76,99.41,99.24,99.65,99.7,99.79,99.84,101,101.62,101.98,101.46,102.28,102.14,102.02,102.21,101.61,102.38,102.19,102.04,101.76,101.9,102.01,102.37,103.04,103.42,103.76,104.41,104.75,104.28,103.89,104.09,103.8,105.03,105.86,106.04,106.03,106.13,107.21,107.66,108.08,108.76,108.26,108.71,108.65,108.61,108.86,109.54,108.22,108.77,109.9,110.13,109.6,110.42,110.6,109.73,110.72,111.08,111.14,111.01,110.56,111.57) > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '36' > #'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/1ykay1229600336.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/2zroa1229600336.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.046117852 -0.084983842 0.114546028 0.066893777 [6] -0.011795681 0.026566601 0.091990046 -0.106452950 -0.021224836 [11] 0.051548743 0.022868510 0.104866006 0.044238845 0.001781459 [16] 0.030704234 0.238807694 -0.028883175 0.089730405 0.045004939 [21] -0.055617793 -0.113600797 -0.156179500 0.144891028 -0.075069806 [26] -0.016495608 0.076982457 -0.098516162 0.079613188 0.101885545 [31] 0.064600424 -0.074517571 0.008159898 0.014966375 0.009916841 [36] 0.007203631 -0.109485346 > (mypacf <- c(rpacf$acf)) [1] -0.046117852 -0.087296365 0.107302893 0.071053216 0.013143230 [6] 0.025810224 0.081287057 -0.102193814 -0.024544806 0.011839227 [11] 0.034387720 0.135085792 0.057908382 0.013500276 0.027238924 [16] 0.219521440 -0.023467611 0.124310574 -0.011380650 -0.046816503 [21] -0.144162040 -0.246293135 0.070461576 -0.045140245 0.048619311 [26] 0.090541214 -0.094313003 0.059580187 0.063738378 0.019462423 [31] -0.059804262 -0.059163035 -0.004348812 0.028100152 -0.011905862 [36] -0.103466402 > 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/3l0ql1229600336.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/4tjvr1229600336.tab") > > system("convert tmp/1ykay1229600336.ps tmp/1ykay1229600336.png") > system("convert tmp/2zroa1229600336.ps tmp/2zroa1229600336.png") > > > proc.time() user system elapsed 0.562 0.326 0.696