R version 2.11.1 (2010-05-31) Copyright (C) 2010 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(93,92,91,89,87,86,87,89,90,90,91,93,93,87,89,92,98,92,92,87,92,98,101,102,102,90,87,92,105,90,88,83,98,109,118,118,115,107,101,111,128,115,111,105,120,132,135,142,139,127,113,130,143,139,137,134,139,157,152,153,147,132,117,123,139,134,134,128,118,144,140,151,144,135,122,124,146,146,147,148,132,161,159,173) > 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/rcomp/tmp/13puj1282221248.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/2wgt41282221248.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.02633855 -0.12692507 -0.35982016 -0.19316617 0.18382934 [7] 0.19953691 0.19276615 -0.10266951 -0.33557765 -0.17491114 -0.09849512 [13] 0.72051812 0.12347350 -0.14367419 -0.28030141 -0.23518015 0.08770945 [19] 0.15203957 0.14397343 -0.01035355 -0.22611336 -0.20586868 -0.09069069 [25] 0.41985003 0.21855643 -0.11897593 -0.16281683 -0.26607896 0.05142354 [31] 0.12200218 0.11907678 0.04609791 -0.12031497 -0.16171683 -0.07566212 [37] 0.22796967 0.23015076 -0.06840753 -0.03194446 -0.25321862 0.05643491 [43] 0.03495324 0.11860480 0.00769110 -0.03275962 -0.10396183 -0.04666822 [49] 0.10503176 > (mypacf <- c(rpacf$acf)) [1] -0.026338549 -0.127707387 -0.373296635 -0.293674132 0.032467399 [6] 0.030965813 0.114520952 0.015551615 -0.215481571 -0.173306720 [11] -0.303450214 0.579763409 0.153271910 -0.172537353 0.055237436 [16] 0.072719987 -0.168383360 -0.176286889 -0.126839857 -0.048170222 [21] 0.059878687 -0.071795144 0.072918674 -0.125320529 -0.056110804 [26] -0.040665189 0.028773893 -0.205688748 0.005187890 0.073882866 [31] -0.017278642 -0.062748506 0.004793283 0.091091731 -0.022292784 [36] -0.061515930 -0.009627547 0.014157452 0.078472027 0.003333035 [41] 0.107524668 -0.118769049 0.032982172 -0.099730445 -0.035441487 [46] -0.049796099 0.062433251 0.029987566 > 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/3hhss1282221248.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/4khqy1282221248.tab") > > try(system("convert tmp/13puj1282221248.ps tmp/13puj1282221248.png",intern=TRUE)) character(0) > try(system("convert tmp/2wgt41282221248.ps tmp/2wgt41282221248.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.870 0.440 1.271