R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(81.72,76.14,75.93,74.49,74.73,75.56,84.19,79.30,74.70,77.09,74.88,77.56,74.08,68.38,71.63,64.65,69.13,58.10,50.28,46.95,41.76,43.91,41.53,54.04,72.69,99.29,114.57,132.55,131.52,122.77,109.05,101.84,93.75,90.82,89.43,91.27,82.15,76.91,70.13,73.67,68.19,65.10,65.10,60.60,57.58,53.40,61.00,58.13,57.95,61.97,71.81,72.51,68.29,68.61,68.00,60.93,59.71,62.36,56.47) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/rcomp/tmp/1j8vs1292231692.ps",horizontal=F,onefile=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/rcomp/tmp/2chcv1292231692.ps",horizontal=F,onefile=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.921089095 0.774540383 0.569934868 0.353014713 [6] 0.151341065 -0.011999783 -0.130658107 -0.214215772 -0.268526468 [11] -0.304374839 -0.328359285 -0.346555716 -0.348110935 -0.337758681 [16] -0.320361830 -0.298262494 -0.266288307 -0.222203604 -0.170383678 [21] -0.119710353 -0.064149686 -0.017481788 0.025822388 0.052517469 [26] 0.067060391 0.055320569 0.031168448 0.005306073 -0.014196818 [31] -0.016981069 -0.005614351 0.024490368 0.053026111 0.077041369 [36] 0.085734214 0.078100278 0.061408495 0.045428414 0.030203167 [41] 0.018071243 0.003292592 -0.006366599 -0.006293952 -0.010651523 [46] -0.012289586 -0.016208866 -0.017997224 -0.015987037 > (mypacf <- c(rpacf$acf)) [1] 0.9210890946 -0.4872508707 -0.3658968960 0.0006576456 0.0602989824 [6] 0.0397854672 -0.0292890707 -0.1404113562 -0.0847572059 -0.0554063520 [11] -0.0511250651 -0.0719794426 0.0501314092 -0.0381568071 -0.1308198753 [16] -0.0874595373 0.0380701915 0.0698604642 -0.0207987810 -0.1324810066 [21] 0.0254585126 -0.0450269491 0.0265004011 -0.0987787981 -0.0433851043 [26] -0.1534304326 -0.0191150076 0.0566495949 0.0250567941 0.0418501393 [31] -0.0431178326 -0.0157446520 -0.1012883329 -0.0215602394 0.0021277100 [36] -0.0344131654 0.0227166131 0.0195992644 -0.0766322362 -0.0467040186 [41] -0.0632754412 0.0404291816 0.1014361455 -0.1426827240 -0.0329762727 [46] -0.0386236035 0.0460793503 0.0474922246 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3f0b11292231692.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/rcomp/tmp/4q9sm1292231692.tab") > > try(system("convert tmp/1j8vs1292231692.ps tmp/1j8vs1292231692.png",intern=TRUE)) character(0) > try(system("convert tmp/2chcv1292231692.ps tmp/2chcv1292231692.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.630 0.460 1.061