R version 2.7.0 (2008-04-22) 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(0.2,0.8,1.2,4.5,0.4,5.9,6.5,12.8,4.2,-3.3,-12.5,-16.3,-10.5,-11.8,-11.4,-17.7,-17.3,-18.6,-17.9,-21.4,-19.4,-15.5,-7.7,-0.7,-1.6,1.4,0.7,9.5,1.4,4.1,6.6,18.4,16.9,9.2,-4.3,-5.9,-7.7,-5.4,-2.3,-4.8,2.3,-5.2,-10,-17.1,-14.4,-3.9,3.7,6.5,0.9,-4.1,-7,-12.2,-2.5,4.4,13.7,12.3,13.4,2.2,1.7,-7.2,-4.8,-2.9,-2.4,-2.5,-5.3,-7.1,-8,-8.9,-7.7,-1.1,4,9.6,10.9,13) > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1.0' > 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/1rpe21230048666.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/244bc1230048666.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 2.151691e-01 1.537041e-01 -4.565063e-01 -1.917583e-01 [6] -1.459842e-01 3.172837e-02 1.540616e-01 2.194041e-01 2.602829e-01 [11] -1.263805e-01 -3.003419e-01 -5.537814e-01 -1.689424e-01 -2.446462e-02 [16] 2.587261e-01 1.342317e-01 6.792854e-02 4.759431e-03 -1.426389e-01 [21] -1.334708e-01 -1.667487e-01 2.169132e-02 2.175762e-01 2.948715e-01 [26] 2.104946e-01 1.797335e-02 -1.089278e-01 -1.413525e-01 -1.544189e-02 [31] -3.555921e-02 1.298310e-01 4.204173e-02 1.528921e-01 -4.349105e-02 [36] -1.227304e-01 -2.445022e-01 -1.968970e-01 9.934032e-05 4.007383e-02 [41] 1.625335e-01 1.068146e-02 3.712788e-02 -9.627228e-02 -6.104232e-02 [46] -7.090350e-02 2.725082e-02 1.243748e-01 9.950966e-02 > (mypacf <- c(rpacf$acf)) [1] 0.215169144 0.112620419 -0.541719666 0.009934579 0.124053505 [6] -0.245486986 0.153597044 0.273156648 0.039993315 -0.351964967 [11] -0.168270268 -0.229097695 -0.106262731 -0.084549859 -0.101952482 [16] -0.051955481 -0.101404201 0.103129160 -0.009028090 -0.054081316 [21] 0.045291348 -0.212715116 0.004556797 0.070021025 -0.019908333 [26] 0.012405432 0.010964108 -0.028654867 0.129873122 -0.058855580 [31] 0.002933065 -0.015997084 -0.033501359 -0.040741807 -0.036215545 [36] -0.038612519 -0.069687446 0.030078763 -0.058445273 0.069230180 [41] 0.027343983 -0.071059598 0.045302494 -0.052616596 0.095189535 [46] -0.018204100 -0.055671534 -0.076107573 > 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/3avp51230048666.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/4kkhg1230048666.tab") > > system("convert tmp/1rpe21230048666.ps tmp/1rpe21230048666.png") > system("convert tmp/244bc1230048666.ps tmp/244bc1230048666.png") > > > proc.time() user system elapsed 1.518 0.560 1.612