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(278.1,283.3,287,287.9,279.7,273.2,272.6,274.8,277.2,277.5,278.7,279,280.1,280.8,280.1,270.5,260,258.2,260.1,262.2,263.4,264.7,267.4,266.8,265.2,262.5,255,252.8,249.6,254.2,259.4,260.8,261.6,257.2,249.8,235.2,227.4,223.1,221.6,218.5,220.1,222.1,222.9,222.8,222.1,209,201.7,204.5,208.7,213,218.6,221.9,224.6,226.8,229.6,231.4,229.1,232.7,236.6,242.2,251.5,261.5,266.4,280.9,294.4,308.8,328.8,348.2,365.9,387.5,395.9,395.8) > 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/html/rcomp/tmp/1ost21275817087.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/2zksn1275817087.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.0000000000 0.7966815818 0.5817516904 0.4329763892 0.3058654659 [6] 0.2374309873 0.2374654023 0.2175251089 0.2318028944 0.2754156090 [11] 0.3102829358 0.2835548397 0.1587348881 0.0259261562 -0.0525968988 [16] -0.0630078974 -0.0216500463 0.0446654967 0.0659253158 0.1223321492 [21] 0.0851634804 0.0005497905 -0.0666466897 -0.1404878091 -0.1978406143 [26] -0.1766218237 -0.1523323604 -0.1422527387 -0.1163576073 -0.0729434487 [31] -0.0695744929 -0.1348589002 -0.2125751532 -0.2381926615 -0.2212334586 [36] -0.1585638211 -0.0909723065 -0.0735588136 -0.0717450933 -0.0558562036 [41] -0.0449956111 -0.0632912712 -0.1114778089 -0.1500425193 -0.1454823471 [46] -0.1126140703 -0.0836395369 -0.0750729715 -0.1004867259 > (mypacf <- c(rpacf$acf)) [1] 0.796681582 -0.144949565 0.049785003 -0.059210458 0.082047640 [6] 0.120157594 -0.051526065 0.132532954 0.092186211 0.075917946 [11] -0.091772040 -0.249099067 -0.056392053 0.009166973 0.089751752 [16] 0.058619072 0.055932563 -0.058686730 0.143059181 -0.281344690 [21] -0.079878928 0.013488823 -0.001247471 0.050625922 -0.001491103 [26] -0.069028388 -0.100824434 -0.034437104 0.094963565 -0.041233237 [31] -0.080161664 -0.014365042 0.087735576 0.010385738 0.043641314 [36] -0.103324437 0.015997733 -0.020906475 0.050734345 0.028680845 [41] -0.070809553 -0.021267585 0.043059473 -0.045687789 -0.060442491 [46] -0.085890175 0.013133847 -0.048010678 > 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/322rt1275817087.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/4o3ph1275817087.tab") > > try(system("convert tmp/1ost21275817087.ps tmp/1ost21275817087.png",intern=TRUE)) character(0) > try(system("convert tmp/2zksn1275817087.ps tmp/2zksn1275817087.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.579 0.323 2.476