R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(554.79,562.33,560.85,555.33,543.6,536.66,542.72,593.53,610.76,612.61,611.32,594.17,595.45,590.87,589.38,584.43,573.1,567.46,569.03,620.74,628.88,628.23,612.12,595.4,597.14,593.41,590.07,579.8,574.21,572.78,572.94,619.57,625.81,619.92,587.63,565.74,557.27,560.58,548.85,531.67,525.92,511.04,498.66,555.36,564.59,541.66,527.07,509.85,514.26,516.92,507.56,492.62,490.24,469.36,477.58,528.38,533.59,517.95,506.17,501.87) > par5 = '12' > par4 = '0' > 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: 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/158v61229185243.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/2jzvg1229185243.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.8850420520 0.7227415001 0.6055796689 0.5548369939 [6] 0.5498024568 0.5091534392 0.4330082630 0.3616693524 0.3368751391 [11] 0.3671099099 0.4309515146 0.4391639460 0.3003504890 0.1432708083 [16] 0.0303774676 -0.0150865908 -0.0292204439 -0.0824744084 -0.1518268428 [21] -0.2148958069 -0.2321261580 -0.2031747659 -0.1565359781 -0.1505111391 [26] -0.2368408793 -0.3321049808 -0.3762430040 -0.3702658318 -0.3409655144 [31] -0.3419326563 -0.3590697541 -0.3735354826 -0.3522362893 -0.3042215789 [36] -0.2455065061 -0.2075703627 -0.2369255313 -0.2676426655 -0.2619636178 [41] -0.2276241214 -0.1850145818 -0.1769531347 -0.1819245681 -0.1775537914 [46] -0.1487011923 -0.1109651624 -0.0681676465 -0.0399918178 -0.0423624073 [51] -0.0390687143 -0.0216762520 0.0078593627 0.0341775986 0.0283304487 [56] 0.0132972240 0.0032682838 0.0009920646 0.0018306967 0.0031914992 > (mypacf <- c(rpacf$acf)) [1] 0.885042052 -0.279454433 0.172677681 0.156543207 0.119470440 [6] -0.183680171 -0.018087438 0.040070392 0.124522800 0.120621251 [11] 0.189238838 -0.178134082 -0.582263074 0.069226324 -0.074473796 [16] -0.041681978 -0.046010359 0.071825614 0.029706579 -0.175726254 [21] 0.041422501 -0.030120128 -0.046260814 0.043221245 0.015807293 [26] -0.045843492 0.069093206 -0.078004744 0.070184794 0.003651870 [31] -0.006805902 -0.045208830 -0.008845206 -0.038390507 -0.010168845 [36] 0.102360705 -0.034890970 0.015916067 -0.027639562 -0.025660279 [41] -0.141871563 -0.035465349 0.047067673 0.014668273 -0.003543568 [46] -0.042294873 0.022070617 -0.078160488 0.131404133 -0.015476308 [51] -0.013364636 -0.015854538 0.020997509 -0.077204875 -0.053935805 [56] 0.008716976 -0.081989730 -0.007611535 -0.046961131 > 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/3h8qz1229185243.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/4n6bo1229185243.tab") > > system("convert tmp/158v61229185243.ps tmp/158v61229185243.png") > system("convert tmp/2jzvg1229185243.ps tmp/2jzvg1229185243.png") > > > proc.time() user system elapsed 0.660 0.392 1.342