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(103.6,104.7,105.5,106.6,107.2,107.5,108.3,108.7,108.8,109.8,109.5,109.2,110.6,110.1,109.9,109.7,109.4,109.4,109.4,109.5,109.5,109.9,110,110.8,112.4,112.8,113.7,114.5,114.8,115.6,115.8,115.8,116.3,116.3,116.8,116.7,116.8,117,117.2,117.1,117.3,117.4,117.7,117.9,118.8,119.9,122.4,123.5,125.6,127.4,128.9,129.5,130.8,132.7,134,132.9,133.1,131.7,128.8,125.1,123.9,121.8,119.2,118.9,119.6,120.2,119.6,121,120.4,120.4,121.4,121.7) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/html/freestat/rcomp/tmp/1euoc1275738706.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/freestat/rcomp/tmp/2euoc1275738706.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.609879565 0.507624602 0.486727218 0.303906284 [6] 0.024254978 -0.053597158 -0.082520898 -0.217171244 -0.336608514 [11] -0.305466221 -0.297090175 -0.350313566 -0.363520804 -0.229329137 [16] -0.183770712 -0.135150815 -0.017758994 0.021349172 0.060564072 [21] 0.094493886 0.112933119 0.130651900 0.118625845 0.105721019 [26] 0.094826339 0.067693942 0.036237061 0.004799748 -0.019577146 [31] -0.056931050 -0.099740813 -0.135187746 -0.138477667 -0.151316675 [36] -0.170760705 -0.110565565 -0.066985267 -0.063152508 -0.018195349 [41] 0.051314064 0.098557099 0.091894401 0.115764587 0.151266941 [46] 0.128145944 0.102402861 0.085572022 0.091738685 > (mypacf <- c(rpacf$acf)) [1] 0.6098795646 0.2160213121 0.1875080424 -0.1516446268 -0.3979501359 [6] -0.1359762229 0.1002637520 0.0325826552 -0.1671142589 -0.1255481999 [11] -0.0290834584 -0.0064049705 -0.1112682807 0.0363173911 0.0372694118 [16] 0.0865868550 0.0431712837 -0.1928742390 -0.0718498582 0.0393546647 [21] 0.0519892923 0.0346187724 -0.0635372000 -0.0599296290 0.0016530332 [26] -0.0035004248 -0.0113673223 -0.0287361624 0.0160944224 -0.0007058553 [31] -0.1165840560 -0.1314420865 -0.0176319044 0.0530311350 0.0179764005 [36] 0.0270080924 -0.0071679907 -0.0473573841 -0.0410029529 0.0147604125 [41] 0.1100690593 0.0317128912 -0.0681667028 -0.0867885725 -0.0371347045 [46] 0.0489995549 -0.0104949068 0.0370723124 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3a4ml1275738706.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/freestat/rcomp/tmp/4ldmo1275738706.tab") > > try(system("convert tmp/1euoc1275738706.ps tmp/1euoc1275738706.png",intern=TRUE)) character(0) > try(system("convert tmp/2euoc1275738706.ps tmp/2euoc1275738706.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.784 0.417 0.860