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(10570,10297,10635,10872,10296,10383,10431,10574,10653,10805,10872,10625,10407,10463,10556,10646,10702,11353,11346,11451,11964,12574,13031,13812,14544,14931,14886,16005,17064,15168,16050,15839,15137,14954,15648,15305,15579,16348,15928,16171,15937,15713,15594,15683,16438,17032,17696,17745,19394,20148,20108,18584,18441,18391,19178,18079,18483,19644,19195,19650) > 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/1l0uc1259259433.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/2unbz1259259433.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.94831396 0.89923784 0.84924578 0.80274841 0.75144820 [7] 0.69602265 0.64812876 0.60109785 0.55560984 0.49330185 0.42971149 [13] 0.36586527 0.31346077 0.25979176 0.21164165 0.17035854 0.13860413 [19] 0.11201235 0.08067606 0.05072551 0.01568666 -0.01595904 -0.05549786 [25] -0.08571815 -0.10908613 -0.13424106 -0.15939782 -0.17881759 -0.19404643 [31] -0.22850273 -0.24833637 -0.28591617 -0.32119180 -0.34868801 -0.37248138 [37] -0.39559096 -0.41176857 -0.41811889 -0.42250415 -0.42229890 -0.42129714 [43] -0.42079505 -0.42131950 -0.41652574 -0.40523098 -0.38843561 -0.36719211 [49] -0.34651432 -0.31610202 -0.28222209 -0.24810108 -0.22399831 -0.20006847 [55] -0.17343065 -0.14295673 -0.11871112 -0.09593293 -0.06422025 -0.03247321 > (mypacf <- c(rpacf$acf)) [1] 0.9483139600 -0.0006110095 -0.0343159073 0.0072886319 -0.0718818170 [6] -0.0732398595 0.0426501097 -0.0193682747 -0.0157495133 -0.1894041889 [11] -0.0682279511 -0.0520140577 0.0652907099 -0.0338753564 0.0290199882 [16] 0.0186771547 0.0513271132 0.0166795720 -0.0364567459 -0.0175574551 [21] -0.0808302275 -0.0421641297 -0.1107730883 0.0376453039 0.0315490111 [26] -0.0797189687 -0.0490525530 0.0447214424 0.0117804650 -0.1997860830 [31] 0.1247557922 -0.1936566307 -0.0752084943 0.0457975628 -0.0213715572 [36] -0.0545035404 0.0535714086 0.0164862256 0.0265732751 0.0284893764 [41] 0.0555244851 -0.0850620914 -0.0228283157 -0.0253420983 0.0450039977 [46] -0.0116942547 0.0134108898 -0.0401344462 0.0781296096 0.0574514492 [51] 0.0314715053 -0.0275614139 -0.0394114034 0.0131178100 0.0649273607 [56] -0.1116051296 0.0002195404 0.1048824455 -0.0220653789 > 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/3n8521259259433.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/41jyb1259259434.tab") > > system("convert tmp/1l0uc1259259433.ps tmp/1l0uc1259259433.png") > system("convert tmp/2unbz1259259433.ps tmp/2unbz1259259433.png") > > > proc.time() user system elapsed 0.594 0.303 0.692