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(104.08,103.86,107.47,111.1,117.33,119.04,123.68,125.9,124.54,119.39,118.8,114.81,117.9,120.53,125.15,126.49,131.85,127.4,131.08,122.37,124.34,119.61,119.97,116.46,117.03,120.96,124.71,127.08,131.91,137.69,142.46,144.32,138.06,124.45,126.71,121.83,122.51,125.48,127.77,128.03,132.84,133.41,139.99,138.53,136.12,124.75,122.88,121.46,118.4,122.45,128.94,133.25,137.94,140.04,130.74,131.55,129.47,125.45,127.87,124.68) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > 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/12qwc1259871796.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/2i1j41259871796.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.18062728 0.28677540 -0.13437866 -0.21875620 -0.43840071 [7] -0.20686950 -0.39810414 -0.05383233 0.03480448 0.21607797 0.17736395 [13] 0.39677003 0.19640965 0.17892768 -0.09268130 -0.03811445 -0.40039334 [19] -0.18799034 -0.28945141 -0.14275539 0.08086576 0.27903954 0.09295441 [25] 0.37563961 0.06061342 0.15458268 -0.03261335 -0.05589315 -0.23474564 [31] -0.14238178 -0.18241771 -0.09485139 -0.03518779 0.06118537 0.15041581 [37] 0.14533529 > (mypacf <- c(rpacf$acf)) [1] 0.1806272825 0.2627207682 -0.2443071368 -0.2748764568 -0.3259588838 [6] -0.0054249645 -0.2918384266 -0.1380382307 0.0300224633 0.0005795972 [11] -0.1182856061 0.1532743121 0.1749424448 0.0339325345 -0.1047936939 [16] 0.2258743433 -0.1198611882 -0.1191422750 0.0307596753 -0.0710641196 [21] 0.0867652486 0.0991734475 -0.1699803151 0.0872784587 -0.0621625860 [26] 0.1259042137 0.0810117632 -0.0037787122 0.1256923997 -0.0761320847 [31] 0.1198240963 -0.0074227168 -0.0323218867 -0.1122778699 0.0620673793 [36] -0.0217315200 > 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/3xkhj1259871797.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/4c4pb1259871797.tab") > > system("convert tmp/12qwc1259871796.ps tmp/12qwc1259871796.png") > system("convert tmp/2i1j41259871796.ps tmp/2i1j41259871796.png") > > > proc.time() user system elapsed 0.556 0.318 0.653