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(120,119,118,116,114,113,114,116,117,117,118,120,123,125,120,116,111,108,113,112,126,124,124,118,119,122,114,108,104,101,107,104,123,125,134,131,127,124,123,117,112,118,123,124,144,148,152,154,146,132,136,128,120,124,126,121,140,142,142,139,131,117,122,112,98,103,108,102,126,129,126,126,112,99,106,104,90,98,99,91,118,115,119,123) > 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/1y1o01282060652.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/2y1o01282060652.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.816049068 0.641916524 0.447040551 0.169367728 [6] 0.013047750 -0.010590085 -0.057361517 0.031565961 0.215903103 [11] 0.322794743 0.418165064 0.513297884 0.339736352 0.159757244 [16] -0.043587909 -0.285948899 -0.429453936 -0.443783757 -0.457689109 [21] -0.360161067 -0.197476932 -0.085506815 -0.002132816 0.071559233 [26] -0.032545923 -0.148970805 -0.279130314 -0.420619119 -0.493965384 [31] -0.466055421 -0.424946472 -0.310156664 -0.163223385 -0.050500340 [36] 0.027855822 0.096807959 0.050839988 -0.010990011 -0.097100684 [41] -0.169870883 -0.195600747 -0.174553044 -0.124358423 -0.052743243 [46] 0.026658933 0.092437654 0.127669719 0.160157891 > (mypacf <- c(rpacf$acf)) [1] 0.81604907 -0.07190108 -0.16785482 -0.39443574 0.15641017 0.37901771 [7] -0.10822880 0.11013677 0.33862652 0.08066801 -0.17884666 0.10226564 [13] -0.53020452 -0.18073098 -0.15398609 0.21009145 -0.08061700 -0.09282782 [19] -0.02371798 0.01773960 -0.12770361 -0.01479285 -0.05805329 -0.02520043 [25] 0.04044177 0.09425877 0.07106737 -0.03550552 -0.04102536 -0.08748714 [31] -0.01161793 -0.04854564 -0.04952584 -0.05156542 0.07318890 0.09582197 [37] 0.03328662 -0.05970933 -0.14520403 0.04157025 0.09646752 -0.17306720 [43] -0.03233874 -0.11815683 0.04488638 -0.05496002 0.05859990 0.01991032 > 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/3ubmr1282060652.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/4mklu1282060652.tab") > > try(system("convert tmp/1y1o01282060652.ps tmp/1y1o01282060652.png",intern=TRUE)) character(0) > try(system("convert tmp/2y1o01282060652.ps tmp/2y1o01282060652.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.800 0.500 1.282