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(161.88,162.05,162.16,162.61,162.53,162.53,162.53,162.53,162.83,161.61,161.79,161.79,161.79,161.79,161.85,161.77,161.86,161.89,161.89,161.89,162.18,162.43,162.58,162.57,162.57,162.57,162.44,162.79,163.15,163.23,163.23,163.23,163.38,163.71,163.73,163.73,163.73,163.73,163.93,164.27,164.57,164.73,164.73,164.76,165.75,165.86,165.99,166.13,166.13,166.13,166.15,166.45,166.48,166.51,166.51,166.51,166.58,166.82,167.35,167.5,167.5,167.6,167.72,167.29,166.98,166.98,166.98,166.98,167.63,167.83,167.85,167.87,167.87,167.96,167.7,169.25,168.79,168.77,168.77,169,168.92,169.23,169.28,169.29,169.29,170.29,170.59,171.98,172.31,172.28,172.28,172.45,172.27,172.65,172.08,172.2,172.2,172.2,172.36,172.53,173.18,173.17,173.17,173.17,173.4,174.47,174.56,174.59,174.59,175.22,175.3,175.25,175.54,175.58,175.58,175.68,176.05,176.4,176.58,176.49) > 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/rcomp/tmp/1kyvt1260037587.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/2g7u31260037587.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.071609750 0.071396473 -0.066218427 0.034264548 [6] -0.042814654 0.020054409 0.013467542 -0.065590382 -0.147767715 [11] 0.067598259 -0.103283742 0.158382329 0.049370190 -0.005870466 [16] -0.099648480 -0.005027353 0.126821762 0.153429674 -0.058285038 [21] 0.018338241 -0.092183562 -0.060931562 -0.086725910 0.004560289 [26] 0.060358491 -0.094334531 -0.014513186 0.007119404 0.034177570 [31] 0.154971035 0.103689339 -0.098570030 -0.104742252 0.032688999 [36] -0.106511538 -0.023610320 0.053555646 -0.051537756 -0.045658492 [41] -0.017738320 0.128429879 0.010165311 0.072954683 -0.030902983 [46] -0.046850830 0.003857919 0.114654799 0.076215583 > (mypacf <- c(rpacf$acf)) [1] -0.071609750 0.066610091 -0.057222390 0.021789164 -0.031500549 [6] 0.008269599 0.023489182 -0.071203283 -0.157837911 0.059154580 [11] -0.087716015 0.133045838 0.091524460 -0.042533776 -0.083979633 [16] -0.022630199 0.126031748 0.177153747 -0.065671243 -0.024912433 [21] -0.022281787 -0.086745213 -0.076193982 -0.046289044 0.070677230 [26] -0.042069126 0.003971107 0.031290938 0.019338297 0.072495301 [31] 0.104728773 -0.105327105 -0.094816221 0.036002543 -0.159843954 [36] -0.024050952 0.057078160 -0.053157317 0.054607355 0.037162667 [41] 0.115561250 0.009096727 -0.019152556 -0.035714693 -0.014886030 [46] -0.011006973 0.084059375 0.051391044 > 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/3e54t1260037587.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/4n5wf1260037587.tab") > > system("convert tmp/1kyvt1260037587.ps tmp/1kyvt1260037587.png") > system("convert tmp/2g7u31260037587.ps tmp/2g7u31260037587.png") > > > proc.time() user system elapsed 0.566 0.312 1.573