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(9.3,8.7,8.2,8.3,8.5,8.6,8.5,8.2,8.1,7.9,8.6,8.7,8.7,8.5,8.4,8.5,8.7,8.7,8.6,8.5,8.3,8,8.2,8.1,8.1,8,7.9,7.9,8,8,7.9,8,7.7,7.2,7.5,7.3,7,7,7,7.2,7.3,7.1,6.8,6.4,6.1,6.5,7.7,7.9,7.5,6.9,6.6,6.9,7.7,8,8,7.7,7.3,7.4,8.1,8.3,8.2) > 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/17kek1261044327.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/29iq41261044327.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.842659534 0.636225608 0.529186929 0.548333001 [6] 0.638852911 0.683904344 0.604916545 0.459582727 0.338686596 [11] 0.317356645 0.336308206 0.346642328 0.262432196 0.164205466 [16] 0.092037349 0.048061574 0.017023744 -0.019578286 -0.080081623 [21] -0.146691434 -0.193525935 -0.209450831 -0.220701562 -0.237887834 [26] -0.294984277 -0.326906249 -0.322330838 -0.299247387 -0.285494582 [31] -0.294923981 -0.328808749 -0.378507870 -0.384530375 -0.324053611 [36] -0.280646682 -0.268343870 -0.296316674 -0.318896212 -0.300304203 [41] -0.245397533 -0.191198178 -0.167201114 -0.191030239 -0.211452470 [46] -0.170220531 -0.085117464 -0.046184294 -0.050927740 -0.085879372 [51] -0.100354275 -0.070975733 -0.014283097 0.012596270 0.015037951 [56] -0.006421673 -0.023932130 -0.004603336 0.031082085 0.034066041 [61] 0.018194194 > (mypacf <- c(rpacf$acf)) [1] 0.8426595340 -0.2547193410 0.2624228075 0.2808666439 0.2693416968 [6] 0.0516826447 -0.1613162771 -0.1165036308 -0.1270418535 0.0184755810 [11] -0.1463350932 0.0157513253 -0.2322706861 0.1353960860 -0.0692474212 [16] -0.0844458363 -0.1099103509 -0.0542080280 -0.0288822259 -0.0883594042 [21] 0.0271335615 -0.0321138451 0.0863056835 -0.0102475075 -0.0676923177 [26] 0.0920036136 0.0311453268 0.0675235430 -0.0322403249 0.0197390058 [31] -0.0541756130 -0.1522473522 0.0148167129 0.0394554027 -0.0813122254 [36] -0.0098293568 -0.0064446849 0.0068441952 0.0195776105 0.0072268209 [41] -0.0238442337 -0.0006468264 -0.0948232262 0.0467416892 0.1169631298 [46] 0.0340695227 -0.0671204121 0.0060911515 -0.0390811389 -0.0381951166 [51] -0.0630533871 -0.0515511165 -0.0747233906 0.0644631913 -0.0274325310 [56] -0.0212938945 -0.0025181409 -0.0513866399 0.0069426390 -0.0627391644 > 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/3halb1261044327.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/4dapw1261044327.tab") > > try(system("convert tmp/17kek1261044327.ps tmp/17kek1261044327.png",intern=TRUE)) character(0) > try(system("convert tmp/29iq41261044327.ps tmp/29iq41261044327.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.594 0.331 1.036