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(102.5,77.7,82.8,77.3,103.1,99.7,99.5,107.2,96.7,97.1,105.2,151.2,102.7,75.4,87.2,83.7,105.8,111.5,99.7,111.2,101.5,110.9,116.3,164.9,118.1,83.7,84,107.2,113.7,120.7,111.2,112.4,112.5,130.4,130.7,174.3,132.2,91.8,104.2,104.8,131.4,141.2,132.7,135.7,136.9,151.2,144,201.5,149.6,108.7,122.8,126.7,139.9,162.5,142.7,151.6,148.1,159,157.8,226.7,153.7,122.3,117.6,166,154.5,183.9,164.4,173.3,160.2,166.4,170.3,238.4,166.8,122.5,141.8,140.5,173.8,188.8,168,187.4,177.7,183.8,196.1,264.6,193.7,141.3,170.1,163.7,190.1,230.7,195.9,210.3,204.7,210.3,221.2,288.2,203.2,162.4,149.2,195.3,213.7,227.9,212.1,226.8,212.6,220.9,228.1,311.6) > 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/1wwxd1259865810.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/23xfk1259865810.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.0000000000 -0.1587320864 -0.1919138513 -0.1997418002 -0.0196076278 [6] -0.0555976520 0.3216458891 -0.0358755502 -0.0005318793 -0.1684974569 [11] -0.2295089364 -0.1383509019 0.7703687973 -0.0787756393 -0.1947628040 [16] -0.1597987083 -0.0292959963 -0.0305584554 0.2649972654 -0.0145699995 [21] -0.0214589371 -0.1141454293 -0.2365366751 -0.0778346536 0.6460679326 [26] -0.0802815530 -0.1365045819 -0.1461556647 -0.0345189137 -0.0118048176 [31] 0.2160860731 -0.0235186342 0.0191588428 -0.1365737023 -0.1593594309 [36] -0.1285302976 0.6000843712 -0.1045427616 -0.0935342175 -0.1419574336 [41] -0.0212096920 -0.0269105418 0.1829700175 -0.0271298576 0.0365440608 [46] -0.1138532680 -0.1426975173 -0.0663448534 0.4396503015 > (mypacf <- c(rpacf$acf)) [1] -0.158732086 -0.222721387 -0.293963737 -0.202987055 -0.280747270 [6] 0.138301980 -0.034208832 0.082911760 -0.052056517 -0.320283451 [11] -0.443820681 0.569476989 0.106081696 -0.126530106 0.019274127 [16] 0.030354507 0.066039685 -0.065063975 -0.047597229 -0.098667895 [21] -0.024049253 -0.029255067 0.043478922 0.147316044 -0.113592608 [26] 0.115351102 0.057508027 0.003836356 0.020351687 -0.059729836 [31] -0.050031363 0.076067397 -0.099011710 0.147077476 -0.153378913 [36] 0.097095614 0.025837603 -0.020636757 0.016344821 -0.047186005 [41] -0.008948193 -0.088480640 0.019862973 -0.031991503 0.003459525 [46] -0.014290737 0.151325760 -0.134609281 > 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/3fvg61259865810.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/4bf5b1259865810.tab") > > system("convert tmp/1wwxd1259865810.ps tmp/1wwxd1259865810.png") > system("convert tmp/23xfk1259865810.ps tmp/23xfk1259865810.png") > > > proc.time() user system elapsed 0.577 0.323 0.675