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.3,14.6,17.7,15.2,22.3,14.8,10,2.9,5.6,16.1,23.7,26.5,20.9,15.9,13,7.8,17.5,24.4,33.7,32.3,33.4,22.2,21.7,12.8,15.2,17.1,17.6,17.5,14.7,12.9,12,11.1,12.3,18.9,24,29.6,30.9,33,34.9,40.1,30.8,31,23.8,30.8,27.6,30.2,22.2,19.9,18.3,15.2,10.1,6.5,1.9,2,4.3,4.8,4.9,2.1,5.5,10.6) > par7 = '0.95' > par6 = 'White Noise' > 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/1dgiq1259965829.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/2jdec1259965829.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.157517546 0.235489943 -0.430112070 -0.183150239 [6] -0.241301637 0.096671479 0.100941849 0.260680599 0.102120984 [11] -0.034303224 -0.260304011 -0.288794182 -0.260027878 -0.059481894 [16] 0.053581725 0.152998219 0.070545639 -0.008697805 0.007268832 [21] -0.073860129 0.095219201 -0.119684899 0.134391007 -0.041076263 [26] 0.189507659 0.015512548 0.095891798 -0.033503495 0.057254510 [31] -0.088991626 -0.079570252 -0.100942775 -0.026981797 0.044630754 [36] 0.077540079 -0.078169251 > (mypacf <- c(rpacf$acf)) [1] 0.157517546 0.216038464 -0.530532448 -0.095020296 0.091023175 [6] -0.014445553 0.002392614 0.151261993 0.050653901 -0.165505889 [11] -0.162933751 -0.099014237 -0.175965133 -0.130552158 -0.065569871 [16] -0.063165360 -0.107903577 -0.075966712 0.201826215 -0.006683374 [21] 0.104361931 -0.145759537 0.049647641 -0.010962867 -0.072760401 [26] 0.018226494 -0.041121257 0.008904069 0.071058949 -0.061375842 [31] -0.111207254 0.074126877 0.009632796 -0.025147269 0.009896939 [36] -0.191602344 > 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/3itea1259965829.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/4n0zz1259965829.tab") > > system("convert tmp/1dgiq1259965829.ps tmp/1dgiq1259965829.png") > system("convert tmp/2jdec1259965829.ps tmp/2jdec1259965829.png") > > > proc.time() user system elapsed 0.551 0.314 0.647