R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(104.3,119.8,116.8,118.2,107.4,110.8,94.8,96.5,113.4,109.8,118.7,117.2,110.3,111.6,128.1,121.3,107.3,120.5,98.5,97.7,113.2,114.6,118.3,123.9,113.6,117.5,130.1,124.7,114.2,127.3,105.9,101.5,120.2,117.1,131.1,130,120.6,123.1,135.3,134.1,123.7,134.6,108.3,110.4,127.8,126.6,131.4,141.1,127,127.3,143.6,149.4,126.6,136.5,116,118,131.4,140.7,144.9,143.9,127.1) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '-0.1' > par1 = '60' > #'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: Write here your technical program description (don't use hard returns!) > 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 (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/1nunc1228573304.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x,par1,main='Autocorrelation',xlab='lags',ylab='ACF') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2uic41228573304.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.56531061 0.36991214 0.33443154 0.12425387 0.18923371 [7] 0.41702139 0.24631597 0.09263392 0.26784570 0.19647774 0.30438509 [13] 0.60313440 0.30524794 0.10441721 0.09280684 -0.06661735 -0.03291543 [19] 0.14736830 0.02376648 -0.09757073 0.01020102 -0.03656469 0.02220835 [25] 0.25613296 0.03765676 -0.10812640 -0.13619419 -0.25146307 -0.21834351 [31] -0.06818787 -0.13733962 -0.23421353 -0.15372886 -0.19817839 -0.15421456 [37] 0.01298745 -0.10855696 -0.21591227 -0.24179297 -0.28384262 -0.26398263 [43] -0.13657773 -0.14800483 -0.21306316 -0.17958147 -0.18256517 -0.16880947 [49] -0.07745932 -0.10889362 -0.16273090 -0.20130844 -0.17623537 -0.16157962 [55] -0.07394858 -0.04532152 -0.04201572 -0.04381321 -0.04328630 -0.03878803 [61] -0.01202129 > (mypacf <- c(rpacf$acf)) [1] 0.5653106146 0.0739774899 0.1462476879 -0.1946764442 0.2229705008 [6] 0.3661486509 -0.2015244338 -0.2500551570 0.4047367971 0.1886571821 [11] 0.1162736707 0.2262254684 -0.4101043671 -0.1091913689 0.0025980520 [16] -0.0381411639 -0.0152325069 -0.2872043569 -0.0196903697 0.1990770835 [21] -0.1517841684 0.0103743575 -0.0741120889 0.0866553620 -0.0006361064 [26] -0.0885691792 -0.0859384679 0.0041851921 -0.0008552028 0.0175830100 [31] -0.0752369749 -0.0700945417 0.0099084870 0.0427174172 -0.0604717007 [36] -0.1088197497 0.0640441731 0.0317184914 -0.0615178855 0.0709756421 [41] -0.0826981778 0.0252601705 0.0760391102 -0.0441579893 -0.0421320470 [46] -0.0192022390 -0.0482345913 -0.0118012645 0.0050834430 0.0637994113 [51] -0.0591135745 0.0061877984 -0.0111167065 0.1182270394 -0.0146765489 [56] 0.0769209083 -0.0033141967 -0.0929824233 0.0112185114 0.1013852341 > 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/3mafl1228573304.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/4jvfh1228573304.tab") > > system("convert tmp/1nunc1228573304.ps tmp/1nunc1228573304.png") > system("convert tmp/2uic41228573304.ps tmp/2uic41228573304.png") > > > proc.time() user system elapsed 0.634 0.341 0.790