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(672.1,674.4,676.6,678.7,680.8,682.9,684,684.1,684.1,684.2,685.9,689.2,692.4,695.7,697.2,696.8,696.4,695.9,696.2,697.2,705.2,706.2,707.4,708.7,710,711.3,711.5,710.7,710,709.2,707.9,706.1,704.4,702.7,701.5,700.8,700,699.3,698.8,698.4,696.8,695.1,694.3,693.4,692.4,691,689.7,688.3,686,683.6,682.6,681.9,681,679.9,678.5,677.5,678,679,679.8,681.3,684.2,687,688.4,689.5,691.1,693.3,695.9,698,699.6,701.6,703.5,705.5,708.1,709.6,710.3) > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '48' > #'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: Write here your technical program description (don't use hard returns!) > 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 (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/1de0k1243952566.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x,par1,main='Autocorrelation',xlab='lags',ylab='ACF') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2wufl1243952566.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.701527633 0.549933925 0.424549331 0.355695917 [6] 0.322709352 0.336891368 0.358648568 0.357673107 0.343408184 [11] 0.235201985 0.111673554 0.058315425 0.009327457 0.010306538 [16] 0.012254000 -0.034358649 -0.059845889 -0.072982417 -0.093779468 [21] -0.207598011 -0.213005268 -0.192852950 -0.224955289 -0.256517136 [26] -0.292924445 -0.316045849 -0.345853468 -0.396289859 -0.414930869 [31] -0.360156256 -0.318501607 -0.301962051 -0.292344583 -0.296964808 [36] -0.288868066 -0.232451826 -0.197437168 -0.190577868 -0.157799850 [41] -0.098172662 -0.092618365 -0.133347239 -0.131455485 -0.090941085 [46] -0.030070529 0.030491851 0.052373506 0.052168483 > (mypacf <- c(rpacf$acf)) [1] 0.7015276327 0.1137971518 0.0056373031 0.0547003515 0.0697478393 [6] 0.1205008185 0.1010473005 0.0429806896 0.0303664218 -0.1524216173 [11] -0.1552342185 -0.0080101278 -0.0623795578 0.0042500205 -0.0209939960 [16] -0.1241223530 -0.0175656447 0.0281728812 0.0218292294 -0.1852704952 [21] 0.0231316420 0.0536888617 -0.1153017327 -0.0937916695 -0.0587566285 [26] -0.0455671495 -0.0908963251 -0.1459869948 -0.0283342531 0.0929772079 [31] -0.0179213028 -0.0153595534 -0.0087876786 -0.0076283044 0.0548747338 [36] 0.0777462186 0.0051727623 -0.0524681415 0.0006842338 0.0194242539 [41] -0.0788774055 -0.1161186131 -0.0094181509 0.0121589108 -0.0034428496 [46] 0.0604822915 0.0337880527 -0.0609305359 > 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/3p7ds1243952566.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/4endf1243952566.tab") > > system("convert tmp/1de0k1243952566.ps tmp/1de0k1243952566.png") > system("convert tmp/2wufl1243952566.ps tmp/2wufl1243952566.png") > > > proc.time() user system elapsed 0.571 0.323 0.768