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(126.51,131.02,136.51,138.04,132.92,129.61,122.96,124.04,121.29,124.56,118.53,113.14,114.15,122.17,129.23,131.19,129.12,128.28,126.83,138.13,140.52,146.83,135.14,131.84,125.7,128.98,133.25,136.76,133.24,128.54,121.08,120.23,119.08,125.75,126.89,126.6,121.89,123.44,126.46,129.49,127.78,125.29,119.02,119.96,122.86,131.89,132.73,135.01,136.71,142.73,144.43,144.93,138.75,130.22,122.19,128.4,140.43,153.5,149.33,142.97) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > par3 = '2' > 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/1e1921260471905.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/22ut61260471905.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.063125775 0.041760095 -0.464992587 -0.059080998 [6] -0.160609381 0.023452758 0.319567079 0.023561291 0.087286323 [11] -0.217693536 0.125148548 -0.303658296 0.068545856 0.061814507 [16] 0.237402716 -0.006447607 -0.066124398 -0.121954219 -0.181689081 [21] -0.049667102 0.181852961 0.230780513 0.032022283 -0.118900119 [26] -0.140416313 -0.108802701 -0.043219869 0.127199282 0.130751444 [31] 0.020905008 -0.061648911 -0.060575018 -0.040703298 -0.069982925 [36] -0.016204612 0.091518840 > (mypacf <- c(rpacf$acf)) [1] -0.063125775 0.037926363 -0.462568279 -0.139137446 -0.196924696 [6] -0.306152825 0.257230285 -0.156742476 -0.047097126 0.056819440 [11] 0.079812043 -0.243673795 0.015752780 0.136354070 -0.006243977 [16] 0.050348413 0.060729751 -0.206043593 -0.027178777 -0.098790882 [21] 0.072218968 0.034754643 0.014914765 -0.108269416 -0.057356384 [26] -0.024355817 -0.045260064 -0.010401943 0.009030240 -0.162807693 [31] 0.013454149 -0.103707730 0.007120095 -0.027959164 -0.149919997 [36] -0.061836530 > 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/3nktz1260471905.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/4cbd91260471905.tab") > system("convert tmp/1e1921260471905.ps tmp/1e1921260471905.png") > system("convert tmp/22ut61260471905.ps tmp/22ut61260471905.png") > > > proc.time() user system elapsed 0.556 0.330 1.340