R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(112,118,129,99,116,168,118,129,205,147,150,267,126,129,124,97,102,127,222,214,118,141,154,226,89,77,82,97,127,121,117,117,106,112,134,169,75,108,115,85,101,108,109,124,105,95,135,164,88,85,112,87,91,87,87,142,95,108,139,159,61,82,124,93,108,75,87,103,90,108,123,129,57,65,67,71,76,67,110,118,99,85,107,141,58,65,70,86,93,74,87,73,101,100,96,157,63,115,70,66,67,83,79,77,102,116,100,135,71,60,89,74,73,91,86,74,87,87,109,137,43,69,73,77,69,76,78,70,83,65,110,132,54,55,66,65,60,65,96,55,71,63,74,106,34,47,56,53,53,55,67,52,46,51,58,91,33,40,46,45,41,55,57,54,46,52,48,77,30,35,42,48,44,45,0,0,46,51,63,84,30,39,45,52,28,40,62) > 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/1rfdp1242207006.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/2515r1242207006.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.356313074 -0.208790793 0.116806873 -0.036483622 [6] 0.033696426 -0.086412851 0.020034262 -0.016448379 0.046901618 [11] -0.055042854 -0.199650992 0.540401341 -0.237715211 -0.091929466 [16] 0.059648117 -0.015256322 0.038793295 -0.050783821 -0.016769395 [21] -0.014777616 0.070698417 -0.119758173 -0.156508702 0.493456367 [26] -0.216014866 -0.082703901 0.071541425 -0.006897982 0.027501120 [31] -0.049213619 -0.027303206 -0.019115069 0.095347419 -0.137964642 [36] -0.114921899 0.439070043 -0.199165278 -0.083516725 0.058112413 [41] 0.030126490 0.013610747 -0.073240811 0.009016173 -0.035712407 [46] 0.059404079 -0.067404087 -0.132344596 0.393401497 > (mypacf <- c(rpacf$acf)) [1] -0.356313074 -0.384575069 -0.165646256 -0.176635233 -0.059454179 [6] -0.168346399 -0.121421858 -0.185141909 -0.090495592 -0.179985317 [11] -0.482542073 0.216405702 -0.037341379 0.115623449 -0.027454429 [16] 0.055966208 0.024108837 0.108942157 0.038077159 0.035016552 [21] 0.104523278 -0.137300695 -0.259158117 0.004625751 -0.064586599 [26] -0.034410946 -0.033357620 -0.015686739 -0.016694595 0.007017612 [31] -0.017288405 -0.021685634 0.084755687 -0.060749672 -0.090890779 [36] 0.038934275 0.021054768 -0.006170511 -0.023475781 0.042554894 [41] 0.018352947 -0.018385981 0.020661320 -0.028018280 -0.066552711 [46] 0.001398335 -0.120282770 0.021317385 > 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/329s91242207006.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/4yf2g1242207006.tab") > > system("convert tmp/1rfdp1242207006.ps tmp/1rfdp1242207006.png") > system("convert tmp/2515r1242207006.ps tmp/2515r1242207006.png") > > > proc.time() user system elapsed 0.576 0.317 0.919