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(101.5,99.2,107.8,92.3,99.2,101.6,87,71.4,104.7,115.1,102.5,75.3,96.7,94.6,98.6,99.5,92,93.6,89.3,66.9,108.8,113.2,105.5,77.8,102.1,97,95.5,99.3,86.4,92.4,85.7,61.9,104.9,107.9,95.6,79.8,94.8,93.7,108.1,96.9,88.8,106.7,86.8,69.8,110.9,105.4,99.2,84.4,87.2,91.9,97.9,94.5,85,100.3,78.7,65.8,104.8,96,103.3,82.9,91.4,94.5,109.3,92.1,99.3,109.6,87.5,73.1,110.7,111.6,110.7,84,101.6,102.1,113.9,99,100.4,109.5,93,76.8,105.3) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '0' > 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: > 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 (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > 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/13qvf1260966359.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2blax1260966359.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.320654039 0.437047560 0.532434598 0.249289913 [6] 0.243517659 0.187894325 -0.072132666 -0.058593774 -0.045797791 [11] -0.282547380 -0.154983010 -0.266494388 -0.230891643 -0.098450776 [16] -0.141918921 -0.183263327 0.055326858 0.018792671 -0.045871789 [21] 0.176411874 0.078212009 0.037103715 0.247055245 0.029695148 [26] -0.010909008 0.128372947 -0.004752919 -0.008199176 0.039087607 [31] -0.152111256 0.042156943 -0.016314475 -0.141616190 -0.015516416 [36] -0.052190675 -0.074273184 0.004543602 -0.020024511 -0.120751761 [41] 0.060784594 -0.036709284 -0.048172642 -0.001573589 -0.003649501 [46] -0.050520546 -0.028539120 -0.027032221 -0.120047011 > (mypacf <- c(rpacf$acf)) [1] 0.320654039 0.372531911 0.420679734 -0.055209593 -0.161413321 [6] -0.161092848 -0.322742538 -0.212752644 0.086773328 -0.007690139 [11] 0.131282454 -0.049932731 0.069088828 0.160395180 0.118465209 [16] -0.160646315 -0.004131779 0.027678885 -0.157440487 -0.004108487 [21] 0.093740729 -0.076528709 0.128428684 -0.038698812 -0.146258369 [26] -0.051469593 0.118932741 0.104149729 0.103382283 -0.125319216 [31] 0.050254860 -0.044435675 -0.055455104 -0.124402661 -0.038334711 [36] 0.036069723 0.004182410 0.067060903 0.045014395 0.013777279 [41] -0.065996177 -0.017087605 -0.049029042 0.017210085 -0.022573189 [46] -0.155701478 0.035050478 -0.040979044 > 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/3lo7e1260966359.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/4gkc41260966359.tab") > > try(system("convert tmp/13qvf1260966359.ps tmp/13qvf1260966359.png",intern=TRUE)) character(0) > try(system("convert tmp/2blax1260966359.ps tmp/2blax1260966359.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.601 0.322 0.751