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(99.9,98.6,107.2,95.7,93.7,106.7,86.7,95.3,99.3,101.8,96,91.7,95.3,96.6,107.2,108,98.4,103.1,81.1,96.6,103.7,106.6,97.6,87.6,99.4,98.5,105.2,104.6,97.5,108.9,86.8,88.9,110.3,114.8,94.6,92,93.8,93.8,107.6,101,95.4,96.5,89.2,87.1,110.5,110.8,104.2,88.9,89.8,90,93.9,91.3,87.8,99.7,73.5,79.2,96.9,95.2,95.6,89.7) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > 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/1aera1260047570.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/23shc1260047570.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.2851218859 0.1908017836 0.1401785220 0.1930432115 [6] 0.1789417065 0.1810099189 0.1282288507 0.0106595142 0.1317038498 [11] 0.0396081997 0.0100373844 -0.1533463607 0.2113679060 0.1868181407 [16] 0.0009220348 0.0043294453 0.0513922002 0.0320873132 -0.0752462741 [21] -0.0312353820 -0.1491404611 -0.1597789128 -0.0370596364 -0.1104630985 [26] -0.1598540463 -0.1472080548 -0.0509520881 -0.1285680514 -0.0662334078 [31] -0.0931145096 0.0094790708 -0.0776998989 -0.0866961039 -0.1289949601 [36] -0.2036169038 -0.1688005815 > (mypacf <- c(rpacf$acf)) [1] 2.851219e-01 1.191974e-01 6.434645e-02 1.340590e-01 8.674224e-02 [6] 8.485603e-02 2.192838e-02 -9.764120e-02 1.012756e-01 -5.885771e-02 [11] -5.444664e-02 -1.939751e-01 3.177766e-01 1.306883e-01 -1.545004e-01 [16] -3.209237e-05 9.863301e-02 -4.034990e-02 -2.286366e-01 -7.694340e-02 [21] -1.718450e-03 -1.778319e-01 4.885204e-03 -4.618288e-02 1.322786e-01 [26] -5.290859e-02 -9.868210e-02 2.437507e-02 1.316224e-01 -1.355243e-01 [31] -1.705002e-02 2.142811e-02 9.178790e-03 -2.189749e-01 -5.821527e-02 [36] -2.772885e-02 > 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/3rksv1260047570.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/4sdln1260047570.tab") > > system("convert tmp/1aera1260047570.ps tmp/1aera1260047570.png") > system("convert tmp/23shc1260047570.ps tmp/23shc1260047570.png") > > > proc.time() user system elapsed 0.538 0.303 0.831