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(29.59,30.7,30.52,32.67,33.19,37.13,35.54,37.75,41.84,42.94,49.14,44.61,40.22,44.23,45.85,53.38,53.26,51.8,55.3,57.81,63.96,63.77,59.15,56.12,57.42,63.52,61.71,63.01,68.18,72.03,69.75,74.41,74.33,64.24,60.03,59.44,62.5,55.04,58.34,61.92,67.65,67.68,70.3,75.26,71.44,76.36,81.71,92.6,90.6,92.23,94.09,102.79,109.65,124.05,132.69,135.81,116.07,101.42,75.73,55.48) > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '-0.2' > 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/1gqba1229700231.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/2xcmr1229700231.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.332115650 0.143945099 0.021790520 -0.053048498 [6] -0.005336199 -0.142628175 -0.024995101 -0.097592426 -0.111980494 [11] 0.074703719 0.094020957 -0.078015490 -0.125607289 -0.052922243 [16] 0.070425310 -0.096721343 -0.115081869 -0.104434294 -0.135591513 [21] -0.066912912 0.091466624 0.148692896 0.053531698 0.074742576 [26] 0.146147741 0.151739967 -0.025059263 -0.046765388 -0.080837688 [31] -0.082543594 -0.053710226 0.019285191 0.049602105 -0.043920821 [36] 0.085931157 0.072643946 0.095291430 0.002369678 -0.056197079 [41] -0.025930132 -0.072871011 0.012563149 -0.087262716 -0.052705595 [46] 0.014771877 0.043111229 0.112178682 -0.009038573 -0.124804968 [51] -0.047858725 -0.111004095 -0.028537994 -0.046093730 -0.090423619 [56] -0.047185063 -0.041188500 -0.005964609 -0.020299968 > (mypacf <- c(rpacf$acf)) [1] 0.332115650 0.037815359 -0.041384559 -0.060489445 0.038065643 [6] -0.158283036 0.071561532 -0.101343795 -0.063169767 0.150010783 [11] 0.060806585 -0.224216868 -0.050081146 0.048961278 0.087896184 [16] -0.184151635 -0.066874003 -0.057519687 -0.036757051 -0.034745378 [21] 0.129687824 0.038753870 0.006429899 0.050816123 0.040795643 [26] 0.039058886 -0.053591763 -0.017492823 -0.066019753 -0.004292154 [31] -0.010887670 0.013242838 0.024480075 -0.013014808 0.111989927 [36] -0.072182300 0.070494136 0.021921581 -0.036887966 -0.015748163 [41] 0.022543862 0.067666666 -0.162743902 0.049117723 0.085010697 [46] -0.015219202 -0.017927995 -0.074430914 -0.138736327 0.059371646 [51] -0.045918350 -0.027347532 0.008625615 -0.006830583 -0.045716931 [56] -0.018971480 -0.114197754 0.012422951 > 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/3k5he1229700231.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/4t01h1229700231.tab") > system("convert tmp/1gqba1229700231.ps tmp/1gqba1229700231.png") > system("convert tmp/2xcmr1229700231.ps tmp/2xcmr1229700231.png") > > > proc.time() user system elapsed 2.861 0.966 3.017