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(36,35,34,32,52,51,36,26,27,27,28,30,28,29,25,28,55,53,42,32,37,41,37,38,39,32,36,39,83,83,66,53,72,77,69,72,81,71,63,66,114,116,109,97,111,120,110,106,115,110,103,112,163,166,156,140,166,176,163,162,171,167,163,168,222,216,197,178,204,220,196,195,213,218,216,225,280,272,252,230,248,259,240,237,252,250,255,255,313,291,271,247,268,283,259,259,267,270,279,269,334,326,301,276,301,313,291,287,289,298,320,312,385,380,351,322,350,363,344,345) > 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/1k3m31281963528.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/2k3m31281963528.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.966559642 0.934124167 0.911221141 0.896509107 [6] 0.875361702 0.847749373 0.826958777 0.802281581 0.776044916 [11] 0.754481221 0.746359260 0.740726499 0.707774540 0.674736446 [16] 0.649936373 0.633674296 0.611881482 0.583115974 0.560938212 [21] 0.535517113 0.509045944 0.486484933 0.473737531 0.462578184 [26] 0.429041245 0.394651173 0.368063530 0.350310856 0.329299190 [31] 0.301388764 0.278518654 0.251453936 0.224820212 0.202179704 [36] 0.187105261 0.172483493 0.141096424 0.108152837 0.081773401 [41] 0.062918260 0.042300541 0.015103196 -0.007618938 -0.032206726 [46] -0.055803710 -0.074809724 -0.089132177 -0.102946537 > (mypacf <- c(rpacf$acf)) [1] 0.9665596420 -0.0017240058 0.1284048551 0.1186460448 -0.0825273874 [6] -0.0809350172 0.0819559582 -0.1129466812 -0.0304981546 0.0801076854 [11] 0.1729081827 0.0550955434 -0.3617300698 -0.0023956235 0.0184718860 [16] 0.0141985348 -0.0102660268 -0.0510494530 0.0374479303 -0.0471341736 [21] -0.0062876207 0.0534393166 0.0002225844 -0.0066049043 -0.1837613782 [26] -0.0251194378 0.0101334533 0.0003423451 0.0319483192 -0.0281547843 [31] -0.0017319883 -0.0624723579 -0.0080126840 0.0313967627 -0.0361541265 [36] -0.0292970410 -0.0640332755 -0.0405049585 -0.0018979224 -0.0225814078 [41] 0.0163067817 -0.0349662218 -0.0046792508 0.0005602138 -0.0193345030 [46] 0.0269413654 -0.0513604499 -0.0258517175 > 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/353291281963528.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/41e3a1281963529.tab") > > try(system("convert tmp/1k3m31281963528.ps tmp/1k3m31281963528.png",intern=TRUE)) character(0) > try(system("convert tmp/2k3m31281963528.ps tmp/2k3m31281963528.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.576 0.311 0.711