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(15 + ,14.4 + ,13.5 + ,12.8 + ,12.3 + ,12.2 + ,14.5 + ,17.2 + ,18 + ,18.1 + ,18 + ,18.3 + ,18.7 + ,18.6 + ,18.3 + ,17.9 + ,17.4 + ,17.4 + ,20.1 + ,23.2 + ,24.2 + ,24.2 + ,23.9 + ,23.8 + ,23.8 + ,23.3 + ,22.4 + ,21.5 + ,20.5 + ,19.9 + ,22 + ,24.9 + ,25.7 + ,25.3 + ,24.4 + ,23.8 + ,23.5 + ,23 + ,22.2 + ,21.4 + ,20.3 + ,19.5 + ,21.7 + ,24.7 + ,25.3 + ,24.9 + ,24.1 + ,23.4 + ,23.1 + ,22.4 + ,21.3 + ,20.3 + ,19.3 + ,18.7 + ,21 + ,24 + ,24.8 + ,24.2 + ,23.3 + ,22.7 + ,22.3 + ,21.8 + ,21.2 + ,20.5 + ,19.7 + ,19.2 + ,21.2 + ,23.9 + ,24.8 + ,24.2 + ,23 + ,22.2 + ,21.8 + ,21.2 + ,20.5 + ,19.7 + ,19 + ,18.4 + ,20.7 + ,24.5 + ,26 + ,25.2 + ,24.1 + ,23.7 + ,23.5 + ,23.1 + ,22.7 + ,22.5 + ,21.7 + ,20.5 + ,21.9 + ,22.9 + ,21.5 + ,19 + ,17 + ,16.1 + ,15.9 + ,15.7 + ,15.1 + ,14.8 + ,14.3 + ,14.5 + ,18.9 + ,21.6 + ,20.4 + ,17.9 + ,15.7 + ,14.5 + ,14 + ,13.9 + ,14.4 + ,15.8 + ,15.6 + ,14.7 + ,16.7 + ,17.9 + ,18.7 + ,20.1 + ,19.5 + ,19.4 + ,18.6 + ,17.8 + ,17.1 + ,16.5 + ,15.5 + ,14.9 + ,18.6 + ,19.1 + ,18.8 + ,18.2 + ,18 + ,19 + ,20.7 + ,21.2 + ,20.7 + ,19.6 + ,18.6 + ,18.7 + ,23.8 + ,24.9 + ,24.8 + ,23.8 + ,22.3 + ,21.7 + ,20.7 + ,19.7 + ,18.4 + ,17.4 + ,17 + ,18 + ,23.8 + ,25.5 + ,25.6 + ,23.7 + ,22 + ,21.3 + ,20.7 + ,20.4 + ,20.3 + ,20.4 + ,19.8 + ,19.5 + ,23.1 + ,23.5 + ,23.5 + ,22.9 + ,21.9 + ,21.5 + ,20.5 + ,20.2 + ,19.4 + ,19.2 + ,18.8 + ,18.8 + ,22.6 + ,23.3 + ,23 + ,21.4 + ,19.9 + ,18.8 + ,18.6 + ,18.4 + ,18.6 + ,19.9 + ,19.2 + ,18.4 + ,21.1 + ,20.5 + ,19.1 + ,18.1 + ,17 + ,17.1 + ,17.4 + ,16.8 + ,15.3 + ,14.3 + ,13.4 + ,15.3 + ,22.1 + ,23.7 + ,22.2 + ,19.5 + ,16.6 + ,17.3 + ,19.8 + ,21.2 + ,21.5 + ,20.6 + ,19.1 + ,19.6 + ,23.5 + ,24 + ,23.2 + ,21.2) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '1' > 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/1rgi01262214060.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/29ytv1262214060.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.9319431793 0.7809942161 0.6188904731 0.5011298175 [6] 0.4368393359 0.4010419817 0.3556272605 0.2780037609 0.1692455358 [11] 0.0523111411 -0.0336353170 -0.0627365177 -0.0325067977 0.0244134136 [16] 0.0658033320 0.0670387781 0.0383729842 0.0004271797 -0.0271495381 [21] -0.0395542199 -0.0428028589 -0.0469317724 -0.0624201102 -0.0935348990 [26] -0.1349983328 -0.1698817255 -0.1890267120 -0.1824359945 -0.1538190887 [31] -0.1150048851 -0.0805194628 -0.0643395320 -0.0738995484 -0.1063764347 [36] -0.1440824745 -0.1693673649 -0.1714253510 -0.1604930942 -0.1496650804 [41] -0.1504408714 -0.1645547549 -0.1831402808 -0.1933813460 -0.1849026711 [46] -0.1516535152 -0.0960226092 -0.0356347399 0.0100938509 0.0291995250 [51] 0.0267299566 0.0131689397 0.0005063740 -0.0089639922 -0.0143290861 [56] -0.0173436943 -0.0209598502 -0.0298661686 -0.0462081182 -0.0641596709 [61] -0.0745370032 > (mypacf <- c(rpacf$acf)) [1] 0.9319431793 -0.6656723564 0.3675595898 0.1885968541 -0.1028784416 [6] -0.0834343747 -0.1395408531 -0.0818109480 -0.0888575141 -0.0162749313 [11] 0.1983867031 0.0795096738 0.1277302432 -0.0877182393 -0.0592587133 [16] 0.0022797064 0.0475314564 -0.1562078971 -0.0767028457 -0.0688656779 [21] -0.0035125588 0.0222141826 -0.0067137803 0.0134277169 0.0143398644 [26] 0.0476059286 -0.0970166021 0.1349694172 0.0358507968 -0.0383833262 [31] -0.0419929055 -0.1597053697 -0.0948350836 -0.1068079418 0.0389050162 [36] 0.0071208925 0.0394763995 -0.0170324688 0.0915691266 0.0483205491 [41] 0.0072856749 0.0338551359 -0.0955222778 -0.0415844988 0.0129336345 [46] 0.0397397182 -0.0277845820 -0.0154400424 -0.0085077255 -0.0160239513 [51] -0.0634522492 -0.0144198780 0.0002126971 0.0345150376 0.0454769850 [56] 0.0200650497 -0.0192649871 0.0095519934 -0.0211832009 -0.0423204753 > 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/308ai1262214060.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/4g9sn1262214060.tab") > try(system("convert tmp/1rgi01262214060.ps tmp/1rgi01262214060.png",intern=TRUE)) character(0) > try(system("convert tmp/29ytv1262214060.ps tmp/29ytv1262214060.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.621 0.326 0.796