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(902.2,891.9,874,930.9,944.2,935.9,937.1,885.1,892.4,987.3,946.3,799.6,875.4,846.2,880.6,885.7,868.9,882.5,789.6,773.3,804.3,817.8,836.7,721.8,760.8,841.4,1045.6,949.2,850.1,957.4,851.8,913.9,888,973.8,927.6,833,879.5,797.3,834.5,735.1,835,892.8,697.2,821.1,732.7,797.6,866.3,826.3,778.6,779.2,951,692.3,841.4,857.3,760.7,841.2,810.3,1007.4,931.3,931.2) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > par3 = '1' > 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/16wle1259334598.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/2d3ss1259334598.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.213291516 -0.281962487 0.172101608 0.023799301 [6] -0.112307004 -0.001090014 0.276004256 -0.331917810 -0.024360305 [11] 0.249508962 -0.060054986 -0.309632357 -0.133586315 0.302076089 [16] -0.135301749 -0.029451745 0.188496305 -0.156010573 -0.106893692 [21] 0.047009362 0.260156982 -0.243160093 0.066224231 0.171174259 [26] -0.135034958 0.041167231 0.016683941 0.017552620 -0.111348386 [31] 0.073399241 0.059466501 -0.049787290 -0.006219330 -0.003029829 [36] 0.023795597 -0.045894907 > (mypacf <- c(rpacf$acf)) [1] -0.213291516 -0.343062807 0.021559986 -0.022052830 -0.055598996 [6] -0.055012253 0.257043235 -0.254614617 -0.001176487 0.044659753 [11] 0.062283841 -0.308824029 -0.395646588 -0.031354881 -0.021556073 [16] -0.059644312 0.030166718 -0.041570295 -0.004673972 -0.213395199 [21] 0.071413456 -0.051652845 0.164864638 -0.167337388 -0.144433399 [26] -0.043595818 0.047181525 -0.123151931 0.066678082 -0.061504967 [31] -0.080735214 -0.086890739 0.011061867 0.121994657 0.057874317 [36] -0.002714332 > 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/3my991259334598.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/40lls1259334598.tab") > > system("convert tmp/16wle1259334598.ps tmp/16wle1259334598.png") > system("convert tmp/2d3ss1259334598.ps tmp/2d3ss1259334598.png") > > > proc.time() user system elapsed 0.551 0.330 0.658