R version 2.10.1 (2009-12-14) 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(237,236,235,233,231,230,231,233,234,234,235,237,246,245,240,239,231,224,229,231,238,240,237,239,248,239,237,232,216,209,214,217,217,227,218,220,229,224,216,208,191,190,196,196,200,204,193,194,207,209,193,175,157,150,162,157,160,167,159,161,179,180,169,152,128,125,131,135,141,154,152,147,163,165,147,130,106,107,115,114,124,141,139,129) > 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/rcomp/tmp/1npls1278093391.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/2npls1278093391.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.95617007 0.90067852 0.85137550 0.79835279 0.75644573 [7] 0.72662233 0.69107587 0.66317290 0.65463116 0.65237781 0.66098915 [13] 0.65508507 0.60529430 0.54348069 0.48928390 0.43312211 0.38953809 [19] 0.35662555 0.31561186 0.28103196 0.26307999 0.24836955 0.24221680 [25] 0.22670569 0.17609263 0.11643055 0.06358463 0.01112318 -0.02947692 [31] -0.05898350 -0.09715038 -0.12684871 -0.14160419 -0.15357044 -0.15626161 [37] -0.16427397 -0.19719074 -0.23710809 -0.26792732 -0.29780877 -0.31737232 [43] -0.33069237 -0.34989372 -0.36343934 -0.36485007 -0.36574360 -0.36149990 [49] -0.35944985 -0.37529030 -0.39774294 -0.41095239 -0.42208073 -0.42189435 [55] -0.41664473 -0.41797430 -0.41273980 -0.39795895 -0.38493557 -0.37003274 [61] -0.35332154 > (mypacf <- c(rpacf$acf)) [1] 0.9561700698 -0.1584193543 0.0624314833 -0.0938818137 0.1279183433 [6] 0.0698137715 -0.0963643149 0.1005749270 0.1803033403 0.0646849601 [11] 0.1356695114 -0.2332083932 -0.4445212495 -0.0879440067 0.0898351358 [16] 0.0253155909 0.0870530196 0.0157380829 -0.0624310704 -0.0191176328 [21] -0.0400835629 -0.1183265813 0.0178951760 -0.0192245181 -0.1368363506 [26] -0.0202325409 -0.0018040811 0.0007912463 0.0062148976 -0.0057656674 [31] -0.0692693368 0.0328011082 -0.0215206389 -0.0544832125 0.0193174156 [36] -0.0002425576 0.0079276099 -0.0062296617 0.0260908724 -0.0012138250 [41] -0.0118645781 -0.0621902829 0.0027265952 -0.0017325333 0.0084707766 [46] -0.0459601144 -0.0411644155 0.0130671658 0.0400201726 -0.0535653876 [51] 0.0060360777 -0.0095084217 0.0732305746 -0.0288290417 -0.0426711241 [56] 0.0110625057 0.0215039294 -0.0213648125 -0.0479004345 0.0403427054 > 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/3jgjj1278093391.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/4mhz71278093391.tab") > > try(system("convert tmp/1npls1278093391.ps tmp/1npls1278093391.png",intern=TRUE)) character(0) > try(system("convert tmp/2npls1278093391.ps tmp/2npls1278093391.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.580 0.340 0.639