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(627,696,825,677,656,785,412,352,839,729,696,641,695,638,762,635,721,854,418,367,824,687,601,676,740,691,683,594,729,731,386,331,707,715,657,653,642,643,718,654,632,731,392,344,792,852,649,629,685,617,715,715,629,916,531,357,917,828,708,858,775,785,1006,789,734,906,532,387,991,841) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '-0.5' > 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/1ycnm1260991076.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/2la331260991076.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.1785456222 -0.3247864303 0.0412624445 -0.0194658598 [6] -0.1055021891 0.0375881859 -0.0764418189 -0.0156352717 0.0205744634 [11] -0.2839130732 0.1098736239 0.7567962297 0.1117040741 -0.3209033949 [16] -0.0093771023 -0.0371803274 -0.1188142053 -0.0250665875 -0.0986275276 [21] -0.0513264893 -0.0258094948 -0.2363216400 0.0515899240 0.5835659206 [26] 0.1215642700 -0.2958012765 -0.0675511671 -0.0403174900 -0.1096886896 [31] -0.0226325135 -0.0776692637 -0.0815201973 -0.0068293045 -0.1465858107 [36] 0.0086197122 0.4256234965 0.0862824743 -0.2436910055 -0.0418062370 [41] -0.0063731122 -0.0798101591 0.0012694549 -0.0356907462 -0.0359955873 [46] 0.0246433955 -0.0940103600 -0.0326791042 0.2713634711 0.0551507943 [51] -0.1517379406 0.0020291334 -0.0091731056 -0.0602775133 0.0091819062 [56] -0.0270484268 -0.0298404975 -0.0013676899 -0.0464326922 0.0008200328 [61] 0.1432819199 > (mypacf <- c(rpacf$acf)) [1] 0.1785456222 -0.3684093205 0.2227658666 -0.2641332688 0.0967440203 [6] -0.0820242217 -0.1035657608 0.0997481085 -0.1734398009 -0.2431079691 [11] 0.3664791758 0.5967464864 -0.1917505391 0.0534386380 -0.1943659801 [16] 0.0546848844 -0.0806844888 -0.1285257512 -0.0534598596 -0.1441597463 [21] -0.0116734334 -0.0081149833 -0.0893586750 0.0886079937 0.0293164055 [26] -0.0214657812 -0.0592948046 -0.0414615215 -0.0017324028 0.0636845648 [31] -0.0664392526 -0.0697195353 0.0887488455 -0.0230299400 -0.0063072770 [36] -0.1551732777 -0.1338303893 0.1187030601 -0.0078726367 0.0576954649 [41] -0.0743185206 0.0214529869 0.1162665899 0.1172683945 -0.0829688455 [46] -0.0247587271 -0.1276910230 -0.0716241604 -0.0291908498 -0.0004047074 [51] 0.0353558378 -0.0506470760 -0.0025844880 -0.0401574880 -0.0268796579 [56] -0.0274769109 -0.0985384714 0.0516924163 0.0603307795 -0.0545248613 > 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/3wfri1260991076.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/43wkb1260991076.tab") > > try(system("convert tmp/1ycnm1260991076.ps tmp/1ycnm1260991076.png",intern=TRUE)) character(0) > try(system("convert tmp/2la331260991076.ps tmp/2la331260991076.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.583 0.321 0.787