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.6,7.7,7.6,8.2,8,8.1,8.3,8.2,8.1,7.7,7.6,7.7,8.2,8.4,8.4,8.6,8.4,8.5,8.7,8.7,8.6,7.4,7.3,7.4,9,9.2,9.2,8.5,8.3,8.3,8.6,8.6,8.5,8.1,8.1,8,8.6,8.7,8.7,8.6,8.4,8.4,8.7,8.7,8.5,8.3,8.3,8.3,8.1,8.2,8.1,8.1,7.9,7.7,8.1,8,7.7,7.8,7.6,7.4,7.7) > par5 = '12' > par4 = '1' > 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/1jmkm1229606754.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/24hh81229606754.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.000000e+00 1.018544e-03 -7.225135e-02 -5.392976e-01 -6.156657e-02 [6] 1.060818e-02 1.628592e-01 -2.746096e-02 4.015162e-02 8.365961e-02 [11] 4.566140e-02 -1.943745e-02 -2.128217e-01 -2.223489e-02 1.820895e-02 [16] 1.486705e-01 -1.386808e-02 1.125505e-02 -1.427720e-01 1.077273e-02 [21] -2.688502e-02 2.350623e-01 -9.254846e-03 4.201564e-02 -2.615416e-01 [26] -3.888340e-02 -3.955014e-03 1.798907e-01 5.504108e-03 -1.744575e-02 [31] -4.529824e-02 4.823188e-05 3.334241e-02 1.788268e-02 -3.795565e-02 [36] -2.856178e-02 4.272777e-02 2.256968e-02 4.408393e-02 -8.052737e-02 [41] 2.201643e-03 1.588531e-02 -2.245336e-02 1.703720e-02 1.567252e-02 [46] -3.934870e-02 6.746788e-03 1.028474e-02 > (mypacf <- c(rpacf$acf)) [1] 0.001018544 -0.072252463 -0.541975026 -0.123433740 -0.113667115 [6] -0.225615566 -0.222610479 -0.095611344 0.044879263 -0.059024296 [11] 0.006249598 -0.137988039 -0.010488455 -0.018535385 -0.061451747 [16] -0.071976721 -0.017130029 -0.170694317 -0.148898983 -0.140419487 [21] 0.138730505 -0.039343474 0.039160258 -0.114051374 -0.067618755 [26] -0.007096601 -0.027256172 -0.102744556 -0.093521505 -0.071495604 [31] -0.151982040 -0.119347497 0.079841092 -0.076223398 -0.039578970 [36] -0.007338050 -0.017816602 0.036150189 -0.002253932 0.015652315 [41] 0.087426836 -0.170418820 -0.007462888 0.013723610 -0.030190523 [46] -0.005739584 0.054276406 > 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/3ccej1229606754.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/4sppt1229606754.tab") > > system("convert tmp/1jmkm1229606754.ps tmp/1jmkm1229606754.png") > system("convert tmp/24hh81229606754.ps tmp/24hh81229606754.png") > > > proc.time() user system elapsed 0.537 0.330 0.770