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(78.4,114.6,113.3,117.0,99.6,99.4,101.9,115.2,108.5,113.8,121.0,92.2,90.2,101.5,126.6,93.9,89.8,93.4,101.5,110.4,105.9,108.4,113.9,86.1,69.4,101.2,100.5,98.0,106.6,90.1,96.9,125.9,112.0,100.0,123.9,79.8,83.4,113.6,112.9,104.0,109.9,99.0,106.3,128.9,111.1,102.9,130.0,87.0,87.5,117.6,103.4,110.8,112.6,102.5,112.4,135.6,105.1,127.7,137.0,91.0,90.5,122.4,123.3,124.3,120.0,118.1,119.0,142.7,123.6,129.6,151.6,110.4,99.2,130.5,136.2,129.7,128.0,121.6,135.8,143.8,147.5,136.2,156.6,123.3,100.4) > par5 = '12' > par4 = '0' > 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: 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/1q3c41228237125.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/2jvte1228237125.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.25801709 -0.38873510 0.30982251 -0.14472159 -0.17003763 [7] 0.37173499 -0.17382967 -0.12368321 0.34902184 -0.45608766 -0.14926565 [13] 0.68165839 -0.11680594 -0.37430582 0.29394103 -0.18199877 -0.09333486 [19] 0.30726283 -0.15744303 -0.07144480 0.26463492 -0.38017908 -0.13905115 [25] 0.55174078 -0.11018565 -0.23706224 0.22709005 -0.17471236 -0.04535247 [31] 0.21844600 -0.11216495 -0.03417201 0.16362281 -0.28898635 -0.07839747 [37] 0.40708792 > (mypacf <- c(rpacf$acf)) [1] -0.2580170854 -0.4877808610 0.0488402358 -0.2859166825 -0.1965259886 [6] 0.1272246475 -0.1465299899 0.0310343209 0.1937859675 -0.4469680098 [11] -0.2791450367 0.3006311832 0.2662998560 -0.0728243521 -0.0274003057 [16] -0.1013102645 0.0587379958 -0.0560951518 0.0179889223 -0.0246703762 [21] -0.1071466322 -0.0821202360 -0.0284553854 -0.0150947778 -0.0307651891 [26] -0.0003719591 0.0843285823 -0.0290613823 0.0843646054 -0.1213235809 [31] 0.0542080167 -0.0413328107 -0.1337918001 -0.0101763909 0.0192695717 [36] 0.0274548702 > 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/3hgc91228237125.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/4glql1228237125.tab") > > system("convert tmp/1q3c41228237125.ps tmp/1q3c41228237125.png") > system("convert tmp/2jvte1228237125.ps tmp/2jvte1228237125.png") > > > proc.time() user system elapsed 0.546 0.297 0.658