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(76.3,71,85.9,109,83.4,101.3,81.6,84.8,88,88.4,85.2,139.5,85.3,79.4,131,91.4,88.2,113.2,81.9,89,95.7,93.2,98,140.5,93,82.1,86.3,84.8,85.7,110.8,87.4,100.4,100.4,99.4,108,161.7,109.3,99.9,110.3,97.5,102.4,122.3,104.4,122.7,127.3,128.4,125.3,187.1,131.4,125.6,142.9,116.6,129.7,155.4,138.7,167.7,155.8,157.1,159.9,244.6,154.3,143.2,147.3,155.1,152.2,166.5,161.2,180.1,169.2,164.5,166.2,267.3) > 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/1lfy51260287065.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/2aiuj1260287065.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.000000000 -0.385501253 -0.128549385 0.178554399 -0.047945418 [6] -0.235300243 0.395089840 -0.265467301 0.005175678 0.198364842 [11] -0.181834243 -0.342567207 0.657974590 -0.276989792 -0.031278821 [16] 0.091979293 -0.041079761 -0.180366330 0.316442791 -0.183028360 [21] -0.010024504 0.158380671 -0.140298053 -0.260177653 0.504960691 [26] -0.219834526 -0.022129631 0.081493186 -0.037806844 -0.145685397 [31] 0.245278637 -0.157298769 0.018231536 0.126112230 -0.133364459 [36] -0.204463517 0.381534431 -0.170643011 0.001885791 0.059314691 [41] -0.050500092 -0.095532455 0.181653217 -0.131704536 0.036012172 [46] 0.125624874 -0.136036748 -0.141186192 0.225749932 > (mypacf <- c(rpacf$acf)) [1] -0.385501253 -0.325539408 -0.016592804 -0.006668678 -0.269638283 [6] 0.217987790 -0.125448262 0.002053340 0.117861515 -0.106218469 [11] -0.445567529 0.347714173 0.081614566 0.104403157 -0.113695744 [16] -0.001500858 0.006668081 -0.040213050 0.129220829 -0.031063565 [21] -0.070650262 -0.087365369 -0.009474128 0.195564720 0.034348342 [26] -0.049714490 -0.036584515 -0.007416696 0.080311958 0.001828245 [31] -0.034840178 -0.023897695 -0.059342265 0.016333437 0.013787410 [36] 0.020410790 -0.031471264 -0.040735823 0.034702646 -0.008805556 [41] 0.019122191 -0.039168275 -0.035407897 0.008732446 0.056118697 [46] -0.005451383 -0.001223350 -0.157557340 > 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/3k9o51260287065.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/4x1981260287065.tab") > > system("convert tmp/1lfy51260287065.ps tmp/1lfy51260287065.png") > system("convert tmp/2aiuj1260287065.ps tmp/2aiuj1260287065.png") > > > proc.time() user system elapsed 0.549 0.314 0.856