R version 2.7.0 (2008-04-22) 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(99.3,98.7,107.9,101.0,97.6,103.0,94.1,94.1,115.1,116.5,103.4,112.5,95.6,97.5,119.3,100.9,97.7,115.3,92.8,99.2,118.7,110.1,110.3,112.9,102.2,99.4,116.1,103.8,101.8,113.7,89.7,99.5,122.9,108.6,114.4,110.5,104.1,103.6,121.6,101.1,116.0,120.1,96.0,105.0,124.7,123.9,123.6,114.8,108.8,106.1,123.2,106.2,115.2,120.6,109.5,114.4,121.4,129.5,124.3,112.6) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '2.0' > 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/1rhib1229683813.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/2bx4m1229683813.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.218782201 0.027446314 0.368789888 -0.044400267 [6] 0.100245179 0.523224113 0.018695873 -0.034236735 0.282255904 [11] -0.103737705 0.113163187 0.651700195 0.050170780 -0.044872260 [16] 0.148338831 -0.197497558 -0.008078768 0.298177670 -0.096788305 [21] -0.085794197 0.097976634 -0.220820690 0.042449217 0.318049155 [26] -0.069585933 -0.078492935 -0.010274518 -0.256903759 -0.071103744 [31] 0.091129290 -0.115938114 -0.095803920 -0.046785997 -0.207393513 [36] -0.026911525 0.126749048 -0.084500744 -0.126063262 -0.113831807 [41] -0.237608176 -0.125957463 -0.058408899 -0.119813875 -0.115410620 [46] -0.132039589 -0.136909823 -0.057772689 -0.003593115 -0.056319637 [51] -0.109237661 -0.123390036 -0.134722609 -0.107752365 -0.078458292 [56] -0.066031358 -0.069552964 -0.066515823 -0.032637203 -0.005395024 > (mypacf <- c(rpacf$acf)) [1] 0.218782201 -0.021445857 0.385993162 -0.260970211 0.278154988 [6] 0.346567544 -0.159067117 -0.060843479 0.085787019 -0.094926651 [11] 0.198178834 0.471506823 -0.182455533 -0.152113056 -0.283575649 [16] 0.018441006 -0.099015251 -0.077121623 0.081415451 0.037712896 [21] -0.038921680 -0.034627879 0.101844498 -0.191798628 0.040121240 [26] -0.035320194 0.077610088 -0.059712357 -0.051841785 -0.063471135 [31] 0.092774001 -0.098310131 -0.011948585 0.087262543 -0.123215310 [36] 0.090742922 -0.108056013 -0.023229429 -0.102569107 0.008187269 [41] -0.033352581 -0.075190216 -0.023474123 0.015085623 0.007718789 [46] 0.029508980 0.051878099 -0.119888457 0.016726770 0.004973036 [51] 0.093648964 -0.078566385 0.034452844 -0.007072787 -0.080264924 [56] 0.059471324 0.029426256 0.009462593 -0.031160595 > 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/3mbh31229683813.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/426qw1229683813.tab") > > system("convert tmp/1rhib1229683813.ps tmp/1rhib1229683813.png") > system("convert tmp/2bx4m1229683813.ps tmp/2bx4m1229683813.png") > > > proc.time() user system elapsed 1.530 0.555 1.640