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(95.20,95.00,94.00,92.20,91.00,91.20,103.40,105.00,104.60,103.80,101.80,102.40,103.80,103.40,102.00,101.80,100.20,101.40,113.80,116.00,115.60,113.00,109.40,111.00,112.40,112.20,111.00,108.80,107.40,108.60,118.80,122.20,122.60,122.20,118.80,119.00,118.20,117.80,116.80,114.60,113.40,113.80,124.20,125.80,125.60,122.40,119.00,119.40,118.60,118.00,116.00,114.80,114.60,114.60,124.00,125.20,124.00,117.60,113.20,111.40,112.20,109.80,106.40,105.20,102.20,99.80,111.00,113.00,108.40,105.40,102.00,102.80) > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1.9' > 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/1mzbx1228482848.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/24nk71228482848.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.047578667 0.098305418 -0.054298820 -0.051074401 [6] -0.072491273 -0.059141993 -0.012719443 0.001838624 0.180153324 [11] -0.158128343 0.026203177 -0.269392556 -0.088676035 0.108518897 [16] -0.008608486 0.024559129 -0.100869216 0.152700376 0.065810046 [21] 0.076188027 0.013275451 0.013178796 0.139930545 -0.145774208 [26] -0.097160577 -0.262285333 0.041891628 -0.075253657 0.114617901 [31] -0.089630064 -0.065636308 0.038892013 -0.090869514 -0.017855195 [36] -0.032801862 0.050316731 0.093923808 0.134577597 -0.113018744 [41] -0.017193329 -0.011348283 -0.096518412 0.047189421 -0.061037691 [46] -0.026289407 0.022221014 -0.032090671 -0.042965425 -0.080694765 [51] -0.049269735 0.054109362 0.100508326 0.003799103 0.086577414 [56] 0.009713278 0.037777219 -0.002908746 0.001647198 > (mypacf <- c(rpacf$acf)) [1] 0.0475786673 0.0962595943 -0.0638404525 -0.0559708277 -0.0568777108 [6] -0.0469715545 -0.0012134428 0.0032665562 0.1731831542 -0.1926897498 [11] 0.0041591223 -0.2437984641 -0.0673027240 0.1935057103 -0.0407340442 [16] -0.0319288695 -0.1669855125 0.1344221025 0.1629255237 0.0097807438 [21] 0.1142978562 -0.1218035217 0.1251309559 -0.1866305152 -0.1451551433 [26] -0.1021822844 0.0038710442 -0.0181704843 0.0007430212 -0.1082808506 [31] 0.0075465365 0.0035573934 0.0267516990 -0.0760349652 0.1172745696 [36] -0.0874337078 -0.0056700820 -0.0232306616 -0.1339643955 0.0533416332 [41] -0.0901642086 -0.1248665962 0.0164853174 -0.0021165539 0.0605519544 [46] -0.0798655322 0.0234368120 0.0002439560 -0.0768132174 -0.0798221700 [51] -0.0136335960 0.0173670360 0.0745183197 -0.0369666682 -0.0382345892 [56] -0.0492289588 0.0346884375 0.0096406801 > 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/35sus1228482848.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/4bf9d1228482848.tab") > > system("convert tmp/1mzbx1228482848.ps tmp/1mzbx1228482848.png") > system("convert tmp/24nk71228482848.ps tmp/24nk71228482848.png") > > > proc.time() user system elapsed 0.596 0.311 0.738