R version 2.11.1 (2010-05-31) Copyright (C) 2010 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(90,69.3,87.3,57.4,56.2,61.6,77.7,177.2,97.6,81.6,96.8,191.3,106,75.1,72,63.5,57.4,62.3,79.4,178.1,109.3,85.2,102.7,193.7,108.4,73.4,85.9,58.5,58.6,62.7,77.5,180.5,102.2,82.6,97.8,197.8,93.8,72.4,77.7,58.7,53.1,64.3,76.4,188.4,105.5,79.8,96.1,202.5,97.3,89.5,64.7,61.2,57.8,62,76.3,195,110.9,81.4,101.7,202.2,97.4,68.5,86.8,59.1,62.4,66.2,68,198.5,120.4,90.2,103.2,207.3,106.4,75.5,97.3,60,67.5,71.2,73.7,213.3,114.6,96.1,117,229.2,105.6,99.9,79.3,72.5,67.4,78.3,85.7,177.4,113.6,94.1,105.7,228.3,100.3,70.3,94.2,66.5,64.4,73.7,87.9,152.2,97.3,89.3,107.6,228.4) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/rcomp/tmp/11r6u1290008166.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/rcomp/tmp/21r6u1290008166.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.15291738 -0.14539735 -0.05598451 0.15492198 -0.25947951 [7] -0.37610939 -0.27864218 0.09002077 -0.07011931 -0.15823657 0.13745418 [13] 0.88117298 0.13621580 -0.13465779 -0.04094350 0.15932436 -0.24360034 [19] -0.33979793 -0.24752689 0.06231125 -0.07292418 -0.13947129 0.11695258 [25] 0.77094058 0.11404512 -0.11957233 -0.03270526 0.15955413 -0.21407312 [31] -0.29448817 -0.21709079 0.04551204 -0.05972781 -0.12761590 0.09735552 [37] 0.65116451 0.09348737 -0.10247868 -0.03110210 0.13330812 -0.17900511 [43] -0.25375087 -0.19155761 0.03080104 -0.06012380 -0.10928534 0.07666155 [49] 0.52939025 > (mypacf <- c(rpacf$acf)) [1] 0.152917377 -0.172822298 -0.003673768 0.148249480 -0.348059225 [6] -0.261013706 -0.301846905 -0.003307247 -0.171371819 -0.236310846 [11] 0.034329249 0.820175727 -0.153371002 -0.008611752 -0.042025003 [16] -0.235580771 0.021273324 0.124110455 0.154775220 0.106643496 [21] -0.001430125 0.037965935 -0.173893005 -0.062697155 -0.005825296 [26] 0.045444029 0.086467672 0.063433100 0.099684364 -0.010005705 [31] -0.074938624 -0.017231823 -0.003195584 -0.031562636 0.061789424 [36] -0.054247241 0.025370683 0.051647653 -0.026499938 -0.082208687 [41] 0.034736965 -0.067716397 -0.023406548 0.023895347 -0.080183122 [46] 0.046677918 -0.026500361 -0.125164748 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3xj431290008166.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/rcomp/tmp/4qsl61290008166.tab") > > try(system("convert tmp/11r6u1290008166.ps tmp/11r6u1290008166.png",intern=TRUE)) character(0) > try(system("convert tmp/21r6u1290008166.ps tmp/21r6u1290008166.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.780 0.480 1.274