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(33,32,31,29,49,48,33,23,24,24,25,27,24,21,15,21,49,48,35,36,51,50,61,63,61,62,58,65,93,94,86,88,102,107,121,127,125,128,117,127,160,162,153,160,177,178,196,212,212,211,204,216,248,250,240,249,275,277,286,302,290,290,277,285,311,300,291,299,332,337,343,360,353,351,341,348,381,358,353,358,399,409,407,419,418,421,414,424,463,437,430,436,474,489,482,492,502,500,493,504,538,516,502,501,541,571,559,569,576,573,562,570,597,573,562,556,600,630,624,634) > 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/1m23a1278525523.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/2wclv1278525523.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.0000000000 0.9758896053 0.9517231363 0.9288564658 0.9085749986 [6] 0.8911199182 0.8714932923 0.8508547169 0.8265791607 0.8028634192 [11] 0.7799719919 0.7578452978 0.7349684701 0.7069988483 0.6788750756 [16] 0.6511910424 0.6264719443 0.6048506260 0.5813203942 0.5564926767 [21] 0.5292430162 0.5041100282 0.4799215943 0.4569436959 0.4334914397 [26] 0.4062829731 0.3791448025 0.3527567804 0.3281227163 0.3066061402 [31] 0.2838905892 0.2606197482 0.2349364889 0.2120998522 0.1905513748 [36] 0.1699724104 0.1494782479 0.1253061800 0.1016110712 0.0785453918 [41] 0.0568829357 0.0389401627 0.0200006836 0.0004974601 -0.0205945787 [46] -0.0387901556 -0.0561354228 -0.0728868108 -0.0895007956 -0.1092957379 [51] -0.1281726906 -0.1457040138 -0.1622171787 -0.1757347983 -0.1898120679 [56] -0.2049593000 -0.2205251713 -0.2330809276 -0.2446527660 -0.2565476368 [61] -0.2682307256 > (mypacf <- c(rpacf$acf)) [1] 0.975889605 -0.013379354 0.014908164 0.042352037 0.049366147 [6] -0.052297935 -0.025951848 -0.084062920 -0.003478630 -0.006540131 [11] -0.003647982 -0.034037478 -0.112168174 -0.017385447 -0.009386072 [16] 0.032120470 0.039873408 -0.043800163 -0.028337819 -0.044926865 [21] 0.024786045 -0.012273138 -0.002003794 -0.028380541 -0.072367768 [26] -0.013898645 -0.004078916 -0.008320473 0.031169202 -0.030490532 [31] -0.011700396 -0.045127225 0.035816444 -0.009450854 -0.009019660 [36] -0.016819645 -0.065230409 -0.009808395 -0.008209090 -0.020887700 [41] 0.038240551 -0.027444478 -0.014472088 -0.026281799 0.034342058 [46] -0.020463684 -0.017040987 -0.019320947 -0.050851715 -0.005411055 [51] 0.007396391 -0.031093914 0.021620864 -0.016595577 -0.026054462 [56] -0.004295101 0.034553944 -0.016965741 -0.033965230 -0.014692052 > 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/3icjj1278525523.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/43di71278525523.tab") > > try(system("convert tmp/1m23a1278525523.ps tmp/1m23a1278525523.png",intern=TRUE)) character(0) > try(system("convert tmp/2wclv1278525523.ps tmp/2wclv1278525523.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.60 0.38 0.67