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(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,43.8,45.29,44.01,47.48,51.07,57.84,69.04,65.61,72.87,68.41,73.25,77.43) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '-0.7' > 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: > 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/1v7wt1262249655.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/212jt1262249655.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.000000e+00 4.332692e-01 3.143829e-01 7.003970e-02 -1.931948e-03 [6] -1.664991e-01 -3.356766e-01 -1.599277e-01 -2.341659e-01 -1.388984e-01 [11] -4.295296e-02 5.332141e-02 -6.707017e-02 -9.833547e-02 -3.131609e-02 [16] 7.914262e-03 -1.657345e-02 -1.014278e-01 -6.042989e-02 -7.182515e-02 [21] -1.022778e-01 2.823492e-02 2.617932e-02 1.654297e-01 2.863948e-02 [26] 2.287908e-01 1.745179e-01 1.187315e-01 -5.229396e-03 -9.302531e-02 [31] -2.636188e-02 -1.575579e-01 -1.083808e-02 -4.544729e-02 2.241653e-02 [36] 4.210487e-06 9.188271e-02 9.141381e-02 2.688672e-02 -2.863632e-02 [41] -6.069366e-02 -4.855926e-02 -8.343382e-02 -7.993599e-02 -1.568674e-01 [46] -1.271361e-01 -3.302156e-02 -6.605888e-02 3.576132e-02 -1.971625e-02 [51] 7.567683e-02 7.222569e-02 2.981533e-02 6.076459e-02 -3.442342e-02 [56] 2.912524e-02 -2.705719e-04 1.320839e-02 7.888845e-03 > (mypacf <- c(rpacf$acf)) [1] 0.433269226 0.155932688 -0.141942865 -0.042416441 -0.158812951 [6] -0.269166799 0.163801749 -0.127530787 -0.058349794 0.128640310 [11] -0.028519890 -0.273683155 -0.023077171 0.005288395 0.008038989 [16] 0.026332111 -0.176630551 -0.133611894 0.015703558 -0.148088106 [21] 0.122778755 0.017869011 0.093177944 -0.157121752 0.160051404 [26] -0.054713482 0.004605990 -0.045854497 -0.059298775 0.019636416 [31] 0.009752971 0.049933672 0.008505560 -0.008879027 0.032015703 [36] 0.050577364 -0.028558733 0.041721743 -0.023047946 -0.054701701 [41] 0.014531921 0.008194299 -0.032174706 -0.151995148 0.041365120 [46] 0.032464951 -0.131415746 0.017082793 -0.049518829 -0.016244884 [51] 0.044521056 -0.116170997 -0.081404360 0.107937514 -0.044313324 [56] 0.026569367 -0.093931465 -0.043049748 > 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/3p4hv1262249655.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/4xdxo1262249656.tab") > > try(system("convert tmp/1v7wt1262249655.ps tmp/1v7wt1262249655.png",intern=TRUE)) character(0) > try(system("convert tmp/212jt1262249655.ps tmp/212jt1262249655.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.583 0.304 1.332