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(108.9,110.5,111.0,110.7,110.0,111.4,107.7,110.4,110.5,106.4,107.5,108.8,107.1,107.9,107.2,106.3,106.7,105.4,109.4,106.7,105.2,107.0,105.4,106.1,105.8,104.2,102.7,102.7,104.9,102.3,104.0,101.2,102.2,101.4,101.1,97.2,99.7,99.4,98.0,103.1,99.4,100.8,96.4,99.7,100.9,101.3,102.6,105.6,107.2,104.0,108.7,104.9,105.3,105.0,106.1,103.7,102.1,97.2,99.5,102.9) > par5 = '12' > par4 = '0' > par3 = '1' > 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/1phxu1228830423.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/2bmpt1228830423.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.4360056765 0.1034840263 -0.0270613757 -0.0225897539 [6] -0.0159103373 0.0238104015 0.0621634283 -0.1794262353 0.1535632666 [11] -0.2523141506 0.3064773688 -0.2562983502 0.0538275740 -0.0325175192 [16] 0.0488964968 0.0930555590 -0.0903992049 0.0208343175 -0.1673130681 [21] 0.1986326374 -0.1045960602 0.0647004605 0.0937686944 -0.2128663305 [26] 0.0481805656 0.1130694268 -0.0669081659 -0.0600326065 0.1127701633 [31] -0.1087468588 0.0303056202 0.1197789338 -0.1236442148 0.0210038825 [36] -0.0822152987 0.0925748038 -0.0113929976 -0.0056075899 -0.0940446957 [41] 0.0689937626 -0.0643483912 0.0290430182 0.0975301199 -0.1225113381 [46] 0.0802415237 -0.0113751029 0.0145247126 0.0426286223 0.0170909391 [51] -0.0988521409 0.0758665889 -0.0134100711 -0.0161063814 -0.0001231392 [56] -0.0249793454 -0.0231278941 0.0193203385 0.0185870413 > (mypacf <- c(rpacf$acf)) [1] -0.436005676 -0.106947802 -0.029659134 -0.045152888 -0.055984242 [6] -0.006800109 0.089997047 -0.144821559 0.012722781 -0.226890461 [11] 0.154897303 -0.116803253 -0.120229748 -0.103942454 0.036033214 [16] 0.147763094 -0.004025513 -0.120626325 -0.168695416 0.016540972 [21] 0.067093002 -0.108360443 0.173875060 -0.150560452 -0.088308096 [26] 0.102456258 -0.068708880 -0.046352403 0.008370547 0.001835287 [31] -0.097140729 0.084520879 0.030734032 -0.113278001 -0.029286283 [36] -0.023785006 -0.054702826 -0.024877751 -0.150912798 0.042379854 [41] -0.078207489 -0.008088811 -0.049484452 -0.013536727 0.051444945 [46] -0.031750296 -0.001924625 0.018771136 -0.016230538 0.060135189 [51] -0.034914647 -0.081777588 -0.004815366 -0.013135953 -0.051476939 [56] -0.042347063 0.032282138 -0.081234561 > 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/3yvx51228830423.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/48fne1228830423.tab") > > system("convert tmp/1phxu1228830423.ps tmp/1phxu1228830423.png") > system("convert tmp/2bmpt1228830423.ps tmp/2bmpt1228830423.png") > > > proc.time() user system elapsed 0.610 0.354 0.727