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(111.85,111.42,109.91,109.70,107.97,109.27,122.63,125.00,124.57,121.77,117.89,119.61,121.12,120.91,119.61,117.24,115.73,117.03,128.02,131.68,132.11,131.68,128.02,128.23,127.37,126.94,125.86,123.49,122.20,122.63,133.84,135.56,135.34,131.90,128.23,128.66,127.80,127.16,125.00,123.71,123.49,123.49,133.62,134.91,133.62,126.72,121.98,120.04,120.91,118.32,114.66,113.36,110.13,107.54,119.61,121.77,116.81,113.58,109.91,110.78,111.42,109.48,106.25,105.60,101.08,103.02,113.79,115.09,111.64,109.05,108.19,111.21,113.79,114.87,115.52,115.73,112.93,115.52,126.51,128.66,125.22,121.55,120.26) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > 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/1rsg21261272991.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/2qk9c1261272991.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.88066204 0.69848608 0.56466508 0.50133940 0.49141998 [7] 0.46618191 0.41252793 0.34412456 0.32451029 0.36745645 0.45166340 [13] 0.48305470 0.34110992 0.15624911 0.01566828 -0.06392376 -0.09301703 [19] -0.12789235 -0.17770578 -0.23402251 -0.24074822 -0.19159024 -0.11487916 [25] -0.08716802 -0.19945003 -0.33709550 -0.42630940 -0.45510203 -0.44296791 [31] -0.43641580 -0.43862991 -0.44467448 -0.40464912 -0.32637563 -0.23484346 [37] -0.18178941 > (mypacf <- c(rpacf$acf)) [1] 0.8806620414 -0.3434391633 0.2057409729 0.1165597950 0.1248425664 [6] -0.1177960839 0.0135246790 -0.0377108503 0.2317937938 0.1150055111 [11] 0.2126741773 -0.2114767336 -0.6246682806 0.1031682363 -0.1264518026 [16] -0.1229966465 -0.0329068207 0.0038141365 0.0339446081 -0.0104285312 [21] 0.0661793895 -0.0053282794 -0.0471653003 -0.0381066106 -0.1484232600 [26] 0.0383632113 0.0022605059 0.0294703165 -0.0521107000 0.0319505273 [31] 0.0275022393 -0.0218869938 0.0060029789 -0.0977249923 0.0008307519 [36] 0.0693129983 > 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/3aijt1261272991.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/4bux11261272991.tab") > > try(system("convert tmp/1rsg21261272991.ps tmp/1rsg21261272991.png",intern=TRUE)) character(0) > try(system("convert tmp/2qk9c1261272991.ps tmp/2qk9c1261272991.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.559 0.325 0.669