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(28029,29383,36438,32034,22679,24319,18004,17537,20366,22782,19169,13807,29743,25591,29096,26482,22405,27044,17970,18730,19684,19785,18479,10698,31956,29506,34506,27165,26736,23691,18157,17328,18205,20995,17382,9367,31124,26551,30651,25859,25100,25778,20418,18688,20424,24776,19814,12738,31566,30111,30019,31934,25826,26835,20205,17789,20520,22518,15572,11509,25447,24090,27786,26195,20516,22759,19028,16971,20036,22485) > 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/1kzqd1262182741.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/2irdk1262182741.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.385435366 0.175431099 -0.020435986 -0.195835438 [6] -0.278863602 -0.501628520 -0.279419356 -0.205261232 -0.084584460 [11] 0.064703463 0.230932572 0.719207997 0.244645090 0.107123780 [16] -0.040224615 -0.179410324 -0.244921569 -0.448956456 -0.262152277 [21] -0.206493385 -0.101366102 0.055266676 0.225911247 0.600415094 [26] 0.274960856 0.139081183 0.013455907 -0.117222847 -0.171686990 [31] -0.326868833 -0.190976507 -0.172029330 -0.101670175 0.024493615 [36] 0.124059911 0.375807257 0.180053673 0.078502178 0.011062537 [41] -0.086737811 -0.121068802 -0.192105045 -0.096790438 -0.098175467 [46] -0.038070704 0.047118382 0.099270648 0.240874846 0.146034730 [51] 0.083154784 0.044945067 -0.026918028 -0.045938551 -0.076080423 [56] -0.068578467 -0.086305954 -0.054939368 -0.009398606 0.022436588 [61] 0.073156638 > (mypacf <- c(rpacf$acf)) [1] 0.3854353656 0.0315591135 -0.1153119724 -0.1867967805 -0.1575118961 [6] -0.3946724327 0.0118962713 -0.1221375203 -0.0965957080 -0.0496041143 [11] 0.0955534426 0.6135164456 -0.4258989639 -0.0963095640 -0.0419664272 [16] 0.0103283786 -0.0534448446 -0.0540605621 -0.1337603297 -0.0850234494 [21] -0.0051010934 0.0581629987 0.0592886116 -0.0808529788 0.1178040599 [26] -0.1006761822 0.0235596098 -0.0105616508 0.0584493231 0.0746662695 [31] -0.0006219389 -0.0468881824 -0.0110327075 -0.0086259133 -0.1572305976 [36] -0.1032537488 -0.0302324979 0.0059225292 -0.0132683548 -0.0084713901 [41] -0.0458659021 0.1052956589 0.0652339951 0.0343873019 0.0552839651 [46] -0.0437237568 0.0280853404 -0.0494746350 0.0851845259 0.0531131244 [51] 0.0368139553 0.0337013271 0.0618022489 -0.0118032117 -0.0776550592 [56] 0.0452999323 -0.0367523252 0.0196771943 0.0148680663 -0.0013360275 > 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/34yjn1262182741.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/4z9021262182741.tab") > > try(system("convert tmp/1kzqd1262182741.ps tmp/1kzqd1262182741.png",intern=TRUE)) character(0) > try(system("convert tmp/2irdk1262182741.ps tmp/2irdk1262182741.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.619 0.346 1.067