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(98.1,98.0,98.3,98.5,98.7,99.3,99.5,99.8,100.3,99.3,99.6,99.3,99.4,99.7,100.0,99.3,100.3,100.8,101.4,101.1,100.6,99.5,99.1,98.8,99.1,98.8,98.5,99.0,99.0,100.6,101.0,101.8,101.8,101.8,101.8,102.4,103.0,103.3,103.6,104.1,104.5,105.6,105.9,106.0,106.3,107.3,107.1,107.3,107.7,108.0,108.9,108.5,109.0,108.9,109.0,108.9,110.3,109.4,108.6,108.0,108.4,108.0,108.0,107.6,107.5,107.9,108.0,107.5,106.8,106.7,107.2,107.8,106.6,106.3,105.7,105.9,106.5,107.2,108.3) > 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/html/rcomp/tmp/1cmtt1289910148.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/2cmtt1289910148.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.96779605 0.93573410 0.90361752 0.87633994 0.84834319 [7] 0.81960101 0.78653361 0.75102171 0.72037736 0.68670527 0.65259182 [13] 0.60974600 0.56370041 0.51750855 0.47360517 0.42337886 0.37838612 [19] 0.33658215 0.29964302 0.26367051 0.22647586 0.17861400 0.12712129 [25] 0.07881452 0.03233135 -0.01762039 -0.06954201 -0.11729745 -0.16546118 [31] -0.20266337 -0.23534267 -0.26309855 -0.29014605 -0.31851363 -0.34422377 [37] -0.36614422 -0.38747148 -0.40810438 -0.42534991 -0.43901491 -0.45159002 [43] -0.45618644 -0.46145243 -0.46298009 -0.46095704 -0.45220100 -0.44677049 [49] -0.44208142 > (mypacf <- c(rpacf$acf)) [1] 0.967796054 -0.014124856 -0.017420507 0.059523275 -0.025788071 [6] -0.027256362 -0.078771203 -0.059265143 0.055927518 -0.075321027 [11] -0.031873483 -0.148405737 -0.085319405 -0.030902957 -0.022642156 [16] -0.142111581 0.058060948 0.031341107 0.054356644 -0.010914246 [21] -0.037468611 -0.182403614 -0.087901285 -0.019421150 -0.025668726 [26] -0.129592706 -0.054427459 0.019874258 -0.079347138 0.075074756 [31] 0.051351803 0.049971433 0.057456341 -0.030006897 0.028331144 [36] 0.028149776 -0.009459528 -0.012753403 -0.041661191 -0.008324691 [41] -0.047626866 0.060241661 -0.050679607 0.051143232 0.018721677 [46] 0.112108200 -0.035822575 0.012168954 > 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/3g5rh1289910148.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/4jnqn1289910148.tab") > > try(system("convert tmp/1cmtt1289910148.ps tmp/1cmtt1289910148.png",intern=TRUE)) character(0) > try(system("convert tmp/2cmtt1289910148.ps tmp/2cmtt1289910148.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.576 0.320 0.750