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(97.7,101.5,119.6,108.1,117.8,125.5,89.2,92.3,104.6,122.8,96,94.6,93.3,101.1,114.2,104.7,113.3,118.2,83.6,73.9,99.5,97.7,103,106.3,92.2,101.8,122.8,111.8,106.3,121.5,81.9,85.4,110.9,117.3,106.3,105.5,101.3,105.9,126.3,111.9,108.9,127.2,94.2,85.7,116.2,107.2,110.6,112,104.5,112,132.8,110.8,128.7,136.8,94.9,88.8,123.2,125.3,122.7,125.7,116.3,118.7,142,127.9,131.9,152.3,110.8,99.1,135,133.2,131,133.9,119.9,136.9,148.9,145.1,142.4,159.6,120.7,109,142) > par5 = '12' > par4 = '1' > par3 = '0' > 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/16kqu1229453827.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/2scl11229453827.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.398389753 0.404925578 0.321920115 0.304861624 [6] 0.311803046 0.276951633 0.251098921 0.189422844 0.245805217 [11] 0.230296216 0.136456118 -0.156771294 0.037495924 -0.020741262 [16] 0.041983926 0.141354587 0.014630695 -0.004513191 0.050689675 [21] 0.017854516 0.039107837 -0.049164538 0.006445015 0.104726678 [26] 0.048364283 0.158457334 0.079608839 -0.070793695 0.013789542 [31] 0.026168771 -0.064075907 -0.027028398 -0.022733496 -0.004361912 [36] -0.050914957 -0.097159886 > (mypacf <- c(rpacf$acf)) [1] 0.398389753 0.292660639 0.118586751 0.096385710 0.116818164 [6] 0.057780848 0.027107122 -0.032458316 0.086974769 0.058399926 [11] -0.090096162 -0.432559855 0.065981528 0.046418636 0.061682819 [16] 0.217584319 -0.005967400 -0.076523006 0.076674614 -0.054585004 [21] 0.107096475 -0.014252768 -0.030075281 -0.002917582 -0.052927303 [26] 0.061996997 0.073461841 -0.124371145 -0.053399405 0.005516606 [31] -0.127105585 -0.051086581 0.125781649 -0.007690768 -0.088367027 [36] -0.088117087 > 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/38gjr1229453827.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/4nc6t1229453828.tab") > > system("convert tmp/16kqu1229453827.ps tmp/16kqu1229453827.png") > system("convert tmp/2scl11229453827.ps tmp/2scl11229453827.png") > > > proc.time() user system elapsed 0.547 0.302 0.640