R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(182900,191400,189300,192200,187900,193900,189100,193100,194800,200200,211500,202100,200300,199200,204900,207300,200000,197700,202200,200200,208300,215100,210700,208100,209000,211000,210200,205500,211400,211700,209300,207500,203300,207100,206900,228700,226900,226500,227100,228100,226500,225200,217800,221300,215300,231300,227100,237800,230200,233400,231100,237200,243700,239700,248400,241000,254500,242800,268300,253900,262100,264100,261000,269300,260400,263200,279200,272200,269200,289600,283200,284300,283000,289100,289600,289100,287400,279600,289300,295000,299600,293600,294400,290200,301000,307900,298800,310300,293900,305000,311300,317300,296200,306800,291800,301900,314600,321500,329400,311700,309700,306500,307100,301300,292200,310100,316800,284400,284600,301200,287600,314300,298200,299400,301900,265500,287100,274000,290100,263100,245200,258600,259800,269800,274600,274800,271100,257800,290300,262200,270000,290600) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/freestat/rcomp/tmp/1ae3f1272639226.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/freestat/rcomp/tmp/2ae3f1272639226.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.448141169 0.088137801 -0.040879282 -0.117172116 [6] 0.167079816 -0.119377481 0.146399656 -0.034364183 -0.048285393 [11] 0.009182613 -0.009057285 0.040346203 0.054039138 -0.085943755 [16] 0.096855557 -0.021139331 -0.039603868 0.011304308 -0.035119907 [21] 0.053706103 -0.014060083 0.024826030 -0.027401332 -0.087266194 [26] 0.011172512 0.039579146 0.107434929 -0.060442898 -0.022769888 [31] -0.066187515 0.047096551 -0.039415578 0.080870078 -0.097021462 [36] 0.097047526 -0.119894170 0.074821237 -0.003216470 -0.016286077 [41] 0.049996108 -0.107463737 0.023467262 -0.018328988 0.064054573 [46] -0.002759116 -0.014038755 -0.080431500 0.089015101 > (mypacf <- c(rpacf$acf)) [1] -0.448141169 -0.141012273 -0.075330533 -0.200870332 0.028360308 [6] -0.044589559 0.093911459 0.088788335 0.008019851 -0.029932372 [11] 0.016227356 0.022280959 0.100294561 -0.025084610 0.071355313 [16] 0.094633380 0.006945977 -0.037866345 -0.040352172 -0.020750468 [21] 0.004246180 0.025126033 -0.023056440 -0.124960807 -0.116564542 [26] -0.019904284 0.129668007 0.030357928 -0.011045799 -0.073340597 [31] 0.018344687 -0.043286293 0.037141882 -0.117902888 0.050333548 [36] -0.050558372 0.067098668 0.005905199 0.024073020 0.012262433 [41] -0.032358452 -0.132534635 -0.071945227 0.041342550 0.083409613 [46] 0.039519258 -0.115495843 -0.013642210 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3oojo1272639226.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/freestat/rcomp/tmp/4hxi91272639226.tab") > > try(system("convert tmp/1ae3f1272639226.ps tmp/1ae3f1272639226.png",intern=TRUE)) character(0) > try(system("convert tmp/2ae3f1272639226.ps tmp/2ae3f1272639226.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.791 0.432 1.001