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(349 + ,336 + ,331 + ,327 + ,323 + ,322 + ,385 + ,405 + ,412 + ,411 + ,410 + ,415 + ,414 + ,411 + ,408 + ,410 + ,411 + ,416 + ,479 + ,498 + ,502 + ,498 + ,499 + ,506 + ,510 + ,509 + ,502 + ,495 + ,490 + ,490 + ,553 + ,570 + ,573 + ,572 + ,575 + ,580 + ,580 + ,574 + ,563 + ,556 + ,546 + ,545 + ,605 + ,628 + ,631 + ,626 + ,614 + ,606 + ,602 + ,589 + ,574 + ,558 + ,552 + ,546 + ,607 + ,636 + ,631 + ,623 + ,618 + ,605 + ,619 + ,596 + ,570 + ,546 + ,528 + ,506 + ,555 + ,568 + ,564 + ,553 + ,541 + ,542 + ,540 + ,521 + ,505 + ,491 + ,482 + ,478 + ,523 + ,531 + ,532 + ,540 + ,525 + ,533 + ,531 + ,508 + ,495 + ,482 + ,470 + ,466 + ,515 + ,518 + ,516 + ,511 + ,500 + ,498 + ,494 + ,476 + ,458 + ,443 + ,430 + ,424 + ,476 + ,481 + ,470 + ,460 + ,451 + ,450 + ,444 + ,429 + ,421 + ,400 + ,389 + ,384 + ,432 + ,446 + ,431 + ,423 + ,416 + ,416 + ,413 + ,399 + ,386 + ,374 + ,365 + ,365 + ,418 + ,428 + ,424 + ,421 + ,417 + ,423 + ,423 + ,419 + ,406 + ,398 + ,390 + ,391 + ,444 + ,460 + ,455 + ,456 + ,452 + ,459 + ,461 + ,451 + ,443 + ,439 + ,430 + ,436 + ,488 + ,506 + ,502 + ,501 + ,501 + ,515 + ,521 + ,520 + ,512 + ,509 + ,505 + ,511 + ,570 + ,592 + ,594 + ,586 + ,586 + ,592 + ,594 + ,586 + ,572 + ,563 + ,555 + ,554 + ,601 + ,622 + ,617 + ,606 + ,595 + ,599 + ,600 + ,592 + ,575 + ,567 + ,555 + ,555 + ,608 + ,631 + ,629 + ,624 + ,610 + ,616 + ,621 + ,604 + ,584 + ,574 + ,555 + ,545 + ,599 + ,620 + ,608 + ,590 + ,579 + ,580 + ,579 + ,572 + ,560 + ,551 + ,537 + ,541 + ,588 + ,607 + ,599 + ,578 + ,563 + ,566 + ,561 + ,554 + ,540 + ,526 + ,512 + ,505 + ,554 + ,584 + ,569 + ,540 + ,522 + ,526 + ,527 + ,516 + ,503 + ,489 + ,479 + ,475 + ,524 + ,552 + ,532 + ,511 + ,492 + ,492 + ,493 + ,481 + ,462 + ,457 + ,442 + ,439 + ,488 + ,521 + ,501 + ,485 + ,464 + ,460 + ,467 + ,460 + ,448 + ,443 + ,436 + ,431 + ,484 + ,510 + ,513 + ,503 + ,471 + ,471 + ,476 + ,475 + ,470 + ,461 + ,455 + ,456 + ,517 + ,525 + ,523 + ,519 + ,509 + ,512 + ,519 + ,517 + ,510 + ,509 + ,501 + ,507 + ,569 + ,580 + ,578 + ,565 + ,547 + ,555 + ,562 + ,561 + ,555 + ,544 + ,537 + ,543 + ,594 + ,611 + ,613 + ,611 + ,594 + ,595 + ,591 + ,589 + ,584 + ,573 + ,567 + ,569 + ,621 + ,629 + ,628 + ,612 + ,595 + ,597 + ,593 + ,590 + ,580 + ,574 + ,573 + ,573 + ,620 + ,626 + ,620 + ,588 + ,566 + ,557 + ,561 + ,549 + ,532 + ,526 + ,511 + ,499 + ,555 + ,565 + ,542 + ,527 + ,510 + ,514 + ,517 + ,508 + ,493 + ,490 + ,469 + ,478 + ,528 + ,534 + ,518 + ,506 + ,502 + ,516 + ,528 + ,533 + ,536 + ,537 + ,524 + ,536 + ,587 + ,597 + ,581 + ,564 + ,558) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '36' > #'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/1uvg01260556002.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/21lkm1260556002.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.00000000 0.95227676 0.87912823 0.81734049 0.77459949 0.74904607 [7] 0.72536273 0.69978007 0.67687926 0.67183272 0.68645937 0.71398518 [13] 0.71919849 0.65462190 0.56783988 0.49304707 0.43905645 0.40365864 [19] 0.37149739 0.33905432 0.30998295 0.29881542 0.30682396 0.32765560 [25] 0.32695583 0.26145395 0.17568146 0.10168528 0.04817915 0.01338805 [31] -0.01764572 -0.04779155 -0.07348398 -0.08113273 -0.06905301 -0.04456816 [37] -0.03961208 > (mypacf <- c(rpacf$acf)) [1] 0.9522767580 -0.2973392638 0.1694518786 0.0937037409 0.1027912052 [6] -0.0391471042 0.0321018704 0.0553304879 0.2014122532 0.1403425994 [11] 0.1538198903 -0.2209915182 -0.6546367161 0.0254333075 0.0309732794 [16] 0.0323127302 0.0441917408 0.0172424660 0.0372716544 -0.0073150653 [21] 0.0222782753 -0.0134727348 0.0155782026 -0.0660499819 -0.2888385099 [26] 0.0291922344 -0.0058808075 -0.0187952140 0.0076353559 -0.0022866185 [31] 0.0234486746 0.0005729358 0.0073731867 0.0094541747 -0.0154218234 [36] 0.0023410961 > 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/3gpx31260556002.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/4xbim1260556002.tab") > > system("convert tmp/1uvg01260556002.ps tmp/1uvg01260556002.png") > system("convert tmp/21lkm1260556002.ps tmp/21lkm1260556002.png") > > > proc.time() user system elapsed 0.588 0.321 0.723