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(12.1,12,11.8,12.7,12.3,11.9,12,12.3,12.8,12.4,12.3,12.7,12.7,12.9,13,12.2,12.3,12.8,12.8,12.8,12.2,12.6,12.8,12.5,12.4,12.3,11.9,11.7,12,12.1,11.7,11.8,11.8,11.8,11.3,11.3,11.3,11.2,11.4,12.2,12.9,13.1,13.5,13.6,14.4,14.1,15.1,15.8,15.9,15.4,15.5,14.8,13.2,12.7,12.1,11.9,10.6,10.7,9.8,9,8.3,9.3,9,9.1,10) > 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/14st01261150106.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/26vwi1261150106.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.928083700 0.822935662 0.698335212 0.553129802 [6] 0.362245159 0.185626473 0.022095584 -0.139309497 -0.293581600 [11] -0.406336441 -0.497538674 -0.580673087 -0.600353447 -0.565556808 [16] -0.509194755 -0.452602192 -0.366709354 -0.276052659 -0.201224260 [21] -0.136640713 -0.058726053 0.007509476 0.056047024 0.100858006 [26] 0.145617765 0.162857289 0.158249667 0.157778404 0.153362873 [31] 0.139573302 0.122876754 0.121713964 0.112419322 0.090254585 [36] 0.068627702 0.060856982 > (mypacf <- c(rpacf$acf)) [1] 0.9280837004 -0.2769617342 -0.1554759298 -0.1907650317 -0.4175857126 [6] 0.0911085049 -0.0537646385 -0.1595206694 -0.0530640263 0.0163655859 [11] -0.1332466503 -0.1676413458 0.3583709167 0.0595248872 -0.0518594108 [16] -0.1193985548 -0.1470068059 -0.1346961969 -0.0851225032 0.0166150016 [21] 0.0253256702 0.0364694472 -0.0296529463 -0.1000392070 0.0723176812 [26] -0.0073489115 -0.0168553712 0.0381871207 -0.0571917908 0.0008276537 [31] -0.0888642809 0.0298904789 -0.0240970005 -0.0485957630 0.0241593806 [36] 0.0466926036 > 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/37xkq1261150106.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/4y46m1261150106.tab") > > try(system("convert tmp/14st01261150106.ps tmp/14st01261150106.png",intern=TRUE)) character(0) > try(system("convert tmp/26vwi1261150106.ps tmp/26vwi1261150106.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.567 0.324 0.718