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(98.8,100.5,110.4,96.4,101.9,106.2,81,94.7,101,109.4,102.3,90.7,96.2,96.1,106,103.1,102,104.7,86,92.1,106.9,112.6,101.7,92,97.4,97,105.4,102.7,98.1,104.5,87.4,89.9,109.8,111.7,98.6,96.9,95.1,97,112.7,102.9,97.4,111.4,87.4,96.8,114.1,110.3,103.9,101.6,94.6,95.9,104.7,102.8,98.1,113.9,80.9,95.7,113.2,105.9,108.8,102.3,99,100.7,115.5,100.7,109.9,114.6,85.4,100.5,114.8,116.5,112.9,102,106,105.3,118.8,106.1,109.3,117.2,92.5,104.2,112.5,122.4,113.3,100,110.7,112.8,109.8,117.3,109.1,115.9,96,99.8,116.8,115.7,99.4,94.3,91,93.2,103.1,94.1,91.8,102.7,82.6,89.1,104.5) > par7 = '0.95' > par6 = 'White Noise' > 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/15zu11260719384.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/2kbcy1260719384.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.478149866 0.567070021 0.651570851 0.361810797 [6] 0.436860543 0.353059502 0.149869619 0.204769284 0.092376456 [11] 0.016558025 0.061916646 -0.076947267 -0.025339241 -0.001135931 [16] -0.023590894 -0.080717653 0.013336743 -0.025236241 -0.117488590 [21] 0.009558326 -0.033381743 -0.148726960 0.065106078 -0.167715622 [26] -0.125613762 -0.009593955 -0.181439557 -0.113434026 -0.102241475 [31] -0.226376251 -0.121069270 -0.140997598 -0.224460387 -0.135840764 [36] -0.209799001 -0.143728260 -0.097944345 -0.108659280 -0.111288509 [41] -0.019912626 -0.015866696 -0.030213827 0.055561883 0.070755457 [46] 0.014419823 0.118779805 0.054319822 -0.022482098 0.095523509 [51] -0.043678964 -0.042920985 -0.002262247 -0.118687672 -0.032839288 [56] -0.078840681 -0.175211593 -0.063788342 -0.109382111 -0.123209457 [61] -0.040012545 > (mypacf <- c(rpacf$acf)) [1] 0.4781498656 0.4387538272 0.4649404967 -0.1648582985 -0.0911925475 [6] -0.1099493525 -0.2164229650 -0.0838074512 -0.0060790185 0.0613399790 [11] 0.1068077883 -0.0471195192 0.0510736908 0.0778550264 0.1460584138 [16] -0.2143643092 -0.0266116401 -0.0068620640 -0.2164701197 -0.0240174931 [21] 0.1653262328 -0.0628472184 0.2074331474 -0.2056621232 -0.0764393406 [26] 0.0095886032 0.0811833281 -0.1517014877 -0.0497477358 -0.0642836703 [31] -0.0625234994 0.0437645302 0.1173793614 -0.0620435712 -0.0314503002 [36] 0.0600072779 0.0916312108 0.0525566787 0.0033335767 -0.0719887313 [41] -0.0179923531 -0.0339398627 -0.0484484140 0.0948176725 0.1134808804 [46] -0.0929386428 -0.0751333536 -0.1748990532 0.0133287883 -0.0202846224 [51] 0.0384643976 -0.0205114954 -0.0019634421 0.0714705663 -0.0651269743 [56] -0.0543801851 0.0009972663 -0.0327883408 -0.0678423559 0.0281319286 > 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/3n9ob1260719384.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/4tqy01260719384.tab") > > try(system("convert tmp/15zu11260719384.ps tmp/15zu11260719384.png",intern=TRUE)) character(0) > try(system("convert tmp/2kbcy1260719384.ps tmp/2kbcy1260719384.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.614 0.328 0.723