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(181.10,191.20,206.20,212.00,224.70,231.30,229.30,227.40,253.90,265.90,277.70,292.10,282.90,292.80,311.00,330.90,350.00,348.50,360.90,345.90,308.80,320.00,322.00,322.90,343.30,354.70,376.60,383.20,392.50,388.20,407.40,412.50,419.80,418.10,389.20,391.60,412.90,385.90,385.50,350.20,336.30,318.50,345.40,377.40,359.50,315.60,307.80,277.40,186.90,160.00,149.10,148.90,137.90,134.00,157.50,175.10,181.00,182.20,207.80,219.40) > 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/12oah1260716935.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/2lqt71260716935.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.38140187 0.13845503 0.19371740 0.10925751 -0.03356322 [7] -0.09943652 0.04883178 0.09284143 -0.03987787 -0.06075219 0.06642294 [13] 0.01881114 -0.01003698 0.09000100 0.00943871 -0.01682213 -0.01954234 [19] -0.08498326 -0.04013234 -0.05797983 -0.10100253 -0.07466808 -0.17444768 [25] -0.14107536 0.01730825 -0.03189323 0.04774648 0.20153922 0.04228644 [31] -0.06181467 -0.08538062 -0.06535395 -0.06657405 -0.09303695 -0.10571556 [37] -0.08936313 > (mypacf <- c(rpacf$acf)) [1] 0.381401867 -0.008206070 0.168064432 -0.023503920 -0.093120277 [6] -0.096401510 0.131630841 0.070335021 -0.077879898 -0.056832854 [11] 0.076390181 -0.024918412 0.048837766 0.092978375 -0.122451650 [16] -0.005008672 0.001987960 -0.087403878 0.031794635 -0.021687663 [21] -0.088155799 -0.031158982 -0.139137579 -0.007484072 0.126830665 [26] -0.026966309 0.093897615 0.143648606 -0.143053556 -0.082571114 [31] -0.052151569 -0.008021942 -0.009263062 0.031306573 -0.126058351 [36] -0.119290748 > 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/3afmx1260716935.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/4opbz1260716935.tab") > > try(system("convert tmp/12oah1260716935.ps tmp/12oah1260716935.png",intern=TRUE)) character(0) > try(system("convert tmp/2lqt71260716935.ps tmp/2lqt71260716935.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.552 0.310 0.645