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(7.4,7.2,7.1,6.9,6.8,6.8,6.8,6.9,6.7,6.6,6.5,6.4,6.3,6.3,6.3,6.5,6.6,6.5,6.4,6.5,6.7,7.1,7.1,7.2,7.2,7.3,7.3,7.3,7.3,7.4,7.6,7.6,7.6,7.7,7.8,7.9,8.1,8.1,8.1,8.2,8.2,8.2,8.2,8.2,8.2,8.3,8.3,8.4,8.4,8.4,8.3,8,8,8.2,8.6,8.7,8.7,8.5,8.4,8.4,8.4,8.5,8.5,8.5,8.5,8.5,8.4,8.4,8.4,8.5,8.6,8.6,8.6,8.6,8.5,8.4,8.4,8.3,8.2,8.1,8.2,8.1,8,7.9,7.8,7.7,7.7,7.9,7.8,7.6,7.4,7.3,7.1,7.1,7,7,7,6.9,6.8,6.7,6.6,6.6) > par5 = '12' > par4 = '0' > 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/1byod1228575147.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/2kolf1228575147.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.00000000 0.97629356 0.94060499 0.90289781 0.86929262 0.83807306 [7] 0.80605469 0.76761347 0.72286814 0.67304930 0.61632185 0.56081420 [13] 0.50640761 0.45909314 0.41660391 0.37258183 0.32048530 0.26575487 [19] 0.21139146 0.15849613 0.10895796 0.06362971 0.02531803 -0.01237835 [25] -0.04763513 -0.08277317 -0.11602214 -0.15073918 -0.18130027 -0.20678784 [31] -0.22793594 -0.24297423 -0.25672796 -0.27427063 -0.29915370 -0.32667067 [37] -0.35094924 -0.36422799 -0.37291900 -0.38050895 -0.38981526 -0.40260826 [43] -0.41845615 -0.43283597 -0.44427963 -0.44881468 -0.44381800 -0.43643569 [49] -0.43125550 -0.43645982 -0.44685639 -0.45663766 -0.45871152 -0.45479431 [55] -0.44550134 -0.43261373 -0.41972612 -0.40500341 -0.39247203 -0.37730673 [61] -0.35920528 > (mypacf <- c(rpacf$acf)) [1] 0.9762935551 -0.2677455718 0.0026895719 0.0800454420 -0.0128941307 [6] -0.0552979585 -0.1440848863 -0.0938153165 -0.0893084372 -0.1751372020 [11] 0.0363382465 -0.0500910986 0.1132671763 0.0372676273 -0.0820256355 [16] -0.1384460904 0.0054662834 -0.0232463064 -0.0694536027 -0.0383787184 [21] 0.0309781742 0.0903081896 -0.0699227607 0.0630476524 0.0104852988 [26] 0.0018398750 -0.1175286167 -0.0006681317 0.0046013976 -0.0032538612 [31] 0.0746271269 -0.0368956901 -0.1324685954 -0.1269790769 -0.0675796549 [36] 0.0152421564 0.0973493769 -0.0340166745 -0.0444379392 -0.0461082043 [41] -0.0374831532 -0.0336258562 0.0128151625 -0.0320919237 0.0705286207 [46] 0.0516559695 -0.0356588883 -0.0387247605 -0.1457538782 -0.0435220933 [51] -0.0492372432 0.0304559749 0.0093137256 0.0335025261 0.0644822787 [56] 0.0260349031 0.0725174812 -0.0366264439 0.0382296128 -0.0110462051 > 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/3lhg41228575147.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/4mpb11228575147.tab") > > system("convert tmp/1byod1228575147.ps tmp/1byod1228575147.png") > system("convert tmp/2kolf1228575147.ps tmp/2kolf1228575147.png") > > > proc.time() user system elapsed 0.663 0.350 0.796