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(95.6,74.3,88.5,88,84.3,112.8,105.3,97.2,112.4,123.2,143.7,205.1,102.8,89.4,90.7,101.1,93.6,119.3,106.4,105.2,106.5,117.6,144.2,195.5,109.5,84.9,102.9,93.9,104.6,115.2,104.9,114.9,115.1,126.4,156.7,197.3,116.1,89.1,107.8,100.4,113.6,128.3,113.3,113.7,116.1,133.6,167.7,214.6,120.3,106,103.9,118,116.3,134.8,117.8,123.3,125.2,135.8,158.9,217.9) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '36' > #'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/1wfda1259357537.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/2j2371259357537.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.719910441 0.454763507 -0.340606833 0.165262588 [6] -0.106024223 0.080827716 -0.026690373 0.005149037 0.038039069 [11] -0.001579341 -0.035438927 -0.123105714 0.154407392 -0.149431906 [16] 0.225138961 -0.112212432 -0.014425361 -0.001313459 0.027197148 [21] -0.103212325 0.205238315 -0.282144500 0.371852129 -0.362115962 [26] 0.298210309 -0.262186796 0.148285637 -0.082252454 0.063683697 [31] -0.019569964 -0.015365868 0.029191578 -0.043886572 0.055554246 [36] -0.079255109 0.107819273 > (mypacf <- c(rpacf$acf)) [1] -0.71991044 -0.13183251 -0.13724309 -0.22915179 -0.18394656 -0.09935959 [7] -0.03768510 -0.05903894 0.03990541 0.15574427 0.06348659 -0.32053999 [13] -0.18195031 -0.16233966 -0.02397449 0.17118017 -0.04828131 -0.11783137 [19] 0.07805937 -0.13832576 0.17112977 -0.11196614 0.06167377 -0.07651452 [25] -0.14204079 -0.02090570 0.05302527 -0.03810662 -0.09940310 -0.12510717 [31] -0.20470856 -0.03994601 0.02305513 -0.03972587 0.01877619 -0.11546363 > 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/3r64o1259357537.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/4yflo1259357537.tab") > > system("convert tmp/1wfda1259357537.ps tmp/1wfda1259357537.png") > system("convert tmp/2j2371259357537.ps tmp/2j2371259357537.png") > > > proc.time() user system elapsed 0.542 0.315 0.644