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(76,75,74,72,70,69,70,72,73,73,74,76,74,67,66,58,55,58,64,68,66,76,75,88,85,83,77,66,65,65,63,62,57,68,69,79,74,76,82,75,75,76,78,77,67,74,68,87,76,88,95,96,96,105,108,113,101,107,102,116,105,121,134,140,131,141,131,128,123,129,125,144,135,141,156,159,146,154,145,133,126,127,122,148) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > 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: > 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/1hrc71282054106.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/2a0ta1282054106.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.94153274 0.91996424 0.87723515 0.84337360 0.79530439 [7] 0.76208365 0.71660709 0.69748036 0.66283886 0.63444481 0.60153762 [13] 0.59512723 0.53381844 0.49926904 0.44638686 0.40456118 0.34489851 [19] 0.30002553 0.24573826 0.21096938 0.16289429 0.12511338 0.08493187 [25] 0.07877624 0.03647240 0.01891929 -0.01255537 -0.03363983 -0.07570655 [31] -0.10949167 -0.14709425 -0.17355213 -0.20204417 -0.22405359 -0.24403474 [37] -0.23896338 -0.25948736 -0.25687735 -0.26323482 -0.26348790 -0.27924791 [43] -0.29628759 -0.31434238 -0.32911471 -0.34335988 -0.35794800 -0.36632591 [49] -0.35971619 -0.36479596 -0.35502333 -0.34854099 -0.33622274 -0.33313261 [55] -0.33135154 -0.33412084 -0.33467767 -0.33433501 -0.33631652 -0.33816282 [61] -0.33290724 > (mypacf <- c(rpacf$acf)) [1] 0.941532737 0.294939205 -0.107744769 -0.024736572 -0.116803621 [6] 0.046510226 -0.052374563 0.166941736 -0.019145672 -0.067376093 [11] -0.033062194 0.196391612 -0.407679100 -0.069745474 -0.002814819 [16] -0.022213533 -0.132547276 0.018112154 0.044822950 -0.068572981 [21] -0.056279848 0.040144128 -0.011559177 0.147268380 -0.036131303 [26] -0.001550261 -0.021838100 -0.044978760 -0.108327569 -0.096835800 [31] 0.087366350 -0.043203370 0.058949973 0.041753441 0.038145005 [36] -0.030858296 -0.065583271 0.048322947 0.005460012 -0.089250208 [41] -0.005566231 -0.103459332 -0.008127369 -0.061867623 0.044149923 [46] -0.020809134 0.026058813 0.006356724 0.032185921 -0.004564838 [51] -0.015552879 -0.049383035 -0.027706974 -0.001211030 -0.069427892 [56] 0.028290614 0.056266310 0.037196508 -0.100096492 -0.048986056 > 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/3v1sy1282054106.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/4h1q41282054106.tab") > > try(system("convert tmp/1hrc71282054106.ps tmp/1hrc71282054106.png",intern=TRUE)) character(0) > try(system("convert tmp/2a0ta1282054106.ps tmp/2a0ta1282054106.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.618 0.314 0.893