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(11.9,13.6,15.2,12.5,14.9,13.7,12.5,13.1,14.5,15.2,16.1,14.8,15.1,14.8,16.1,14.3,15.2,14.9,13.1,12.6,13.6,14.4,14,12.9,13.4,13.5,14.8,14.3,14.3,14,13.2,12.2,14.3,15.7,14.2,14.6,14.5,14.3,15.3,14.4,13.7,14.2,13.5,11.9,14.6,15.6,14.1,14.9,14.2,14.6,17.2,15.4,14.3,17.5,14.5,14.4,16.6,16.7,16.6,16.9,15.7,16.4,18.4,16.9,16.5,18.3,15.1,15.7,18.1,16.8,18.9,19,18.1,17.8,21.5,17.1,18.7,19,16.4,16.9,18.6,19.3,19.4,17.6,18.6,18.1,20.4,18.1,19.6,19.9,19.2,17.8,19.2,22.1,21.2,19.5) > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '48' > #'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/11yu21228602657.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/2508k1228602657.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.379037468 -0.240107313 0.248548172 -0.126738817 [6] -0.134880368 0.314545654 -0.193021006 -0.024543281 0.231171865 [11] -0.320177760 -0.151408027 0.618113628 -0.262767142 -0.122440823 [16] 0.122141514 -0.139198438 -0.001819575 0.169058091 -0.133409377 [21] 0.022913511 0.140517949 -0.320957057 0.081200153 0.297886591 [26] -0.111291588 -0.064499115 0.003162813 -0.074969430 0.060712135 [31] 0.003376344 -0.030763054 0.060898290 0.008179877 -0.183890278 [36] 0.027686018 0.202432793 0.017471210 -0.132704908 -0.016679138 [41] 0.013496250 0.017217528 -0.031066012 0.035099374 0.031547825 [46] -0.031098863 -0.036201705 -0.103912909 0.197729637 > (mypacf <- c(rpacf$acf)) [1] -0.37903747 -0.44816420 -0.07762243 -0.18953190 -0.27854343 0.06972256 [7] -0.11656832 -0.01145748 0.15103502 -0.18943287 -0.43423356 0.27139451 [13] 0.18501009 0.14855031 -0.11366957 -0.11374660 0.01772117 -0.08583047 [19] 0.01045594 -0.06694358 -0.07899203 -0.19032438 0.09913699 0.03545306 [25] 0.14104132 0.03207772 -0.03994764 0.05498055 0.04313123 -0.07717257 [31] -0.10310742 -0.09293231 -0.09332622 0.03965011 -0.22559347 -0.04253008 [37] 0.03268365 -0.04919654 0.02300899 -0.01109587 0.03160557 -0.02442880 [43] -0.00448939 -0.02231829 -0.05478173 0.00901006 -0.09348201 -0.06160922 > 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/3k95c1228602657.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/44c891228602657.tab") > > system("convert tmp/11yu21228602657.ps tmp/11yu21228602657.png") > system("convert tmp/2508k1228602657.ps tmp/2508k1228602657.png") > > > proc.time() user system elapsed 0.592 0.321 0.765