R version 2.11.1 (2010-05-31) Copyright (C) 2010 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(166,165,164,162,160,159,160,162,163,163,164,166,163,166,170,171,176,172,169,180,172,170,161,167,158,163,165,169,168,165,156,157,146,150,146,159,146,151,156,152,152,143,127,126,122,122,114,127,125,123,124,123,127,117,104,110,106,107,100,115,117,123,130,129,125,112,90,96,99,108,101,113,113,120,131,135,137,120,102,114,121,134,122,131) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > 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/rcomp/tmp/1shzb1281184513.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/rcomp/tmp/2shzb1281184513.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.00000000 0.94256458 0.89143074 0.83215370 0.79483118 0.75697183 [7] 0.72947049 0.71792510 0.71764480 0.71165997 0.71591732 0.69990153 [13] 0.69260438 0.62150939 0.55617964 0.48291064 0.42596543 0.36853900 [19] 0.32210500 0.29462502 0.27050731 0.24529215 0.21983832 0.17975640 [25] 0.15252335 0.08628019 0.02372805 -0.03726752 -0.08630941 -0.13390107 [31] -0.17827687 -0.20381155 -0.21680888 -0.22796118 -0.23949055 -0.26616346 [37] -0.28505495 -0.32717079 -0.36399655 -0.39920842 -0.41679512 -0.43114288 [43] -0.44109795 -0.43979496 -0.43085160 -0.42363794 -0.41400115 -0.41770539 [49] -0.41348372 > (mypacf <- c(rpacf$acf)) [1] 0.942564582 0.026913118 -0.097150790 0.158946083 -0.004491453 [6] 0.048492462 0.172785498 0.105489473 -0.034152242 0.147616701 [11] -0.125415026 0.064936596 -0.525872792 -0.052373320 -0.093648007 [16] -0.114210231 -0.104915901 -0.040261968 0.042308749 -0.142519915 [21] 0.056279551 -0.108266517 0.012623215 0.053439241 -0.070215431 [26] -0.037796719 0.094581784 -0.040166502 -0.050081193 -0.018102770 [31] -0.018173811 0.149065184 0.002267026 0.051753652 -0.025542115 [36] -0.003026253 -0.030988959 0.034937988 -0.020374085 0.087828388 [41] 0.030698176 0.017847724 -0.019318119 -0.032100051 -0.028470465 [46] -0.001363092 0.008692181 -0.035997274 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3o9xj1281184513.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/rcomp/tmp/4kjgk1281184514.tab") > > try(system("convert tmp/1shzb1281184513.ps tmp/1shzb1281184513.png",intern=TRUE)) character(0) > try(system("convert tmp/2shzb1281184513.ps tmp/2shzb1281184513.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.77 0.38 1.10