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(595,591,612,595,597,589,584,573,567,569,621,629,628,593,588,566,557,590,580,574,573,573,620,626,620,561,527,510,514,549,532,526,511,499,555,565,542,517,506,502,516,508,493,490,469,478,528,534,518,528,533,536,537,524,536,587,597,581,564,558) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '1' > par1 = '60' > #'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/1mv2b1260388895.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/2e3hf1260388895.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.86375682 0.66642743 0.49274348 0.38433505 0.35123356 [7] 0.28921253 0.20336092 0.11509017 0.05452939 0.03519993 0.00282653 [13] -0.06209579 -0.13692702 -0.16009066 -0.13701519 -0.09572952 -0.09167099 [19] -0.14867834 -0.22434730 -0.29523698 -0.34617864 -0.37442829 -0.40313863 [25] -0.39434130 -0.31795827 -0.24933176 -0.20006783 -0.18114525 -0.20014944 [31] -0.16821729 -0.10506989 -0.03345822 0.01481496 0.03223749 0.03651393 [37] 0.04586914 0.05975158 0.05074944 0.01626230 -0.03105043 -0.04957630 [43] -0.01166006 0.03439743 0.06856697 0.05584616 0.02721811 0.01662009 > (mypacf <- c(rpacf$acf)) [1] 0.863756820 -0.313670114 0.032709916 0.112321397 0.145788678 [6] -0.256106372 -0.013758147 0.006101271 0.043974899 -0.025834003 [11] -0.126418903 -0.104147305 0.001192602 0.158958413 -0.044581932 [16] -0.009677427 -0.109071826 -0.095943018 -0.084721349 -0.120310799 [21] -0.133011452 -0.023802206 -0.038933035 0.106601732 0.196313952 [26] -0.193527647 -0.018082165 0.054090420 -0.089916887 0.111742411 [31] -0.013884889 -0.040859980 -0.052163933 0.121691033 -0.130592249 [36] -0.005142747 0.024571571 -0.034100479 -0.072315384 -0.069916893 [41] -0.039741539 0.036391299 0.006273425 -0.033049693 -0.048589001 [46] 0.027346417 -0.042369501 > 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/370ay1260388895.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/434ha1260388895.tab") > > system("convert tmp/1mv2b1260388895.ps tmp/1mv2b1260388895.png") > system("convert tmp/2e3hf1260388895.ps tmp/2e3hf1260388895.png") > > > proc.time() user system elapsed 0.589 0.321 0.735