R version 2.7.0 (2008-04-22) 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(98.6,98,106.8,96.7,100.2,107.7,92,98.4,107.4,117.7,105.7,97.5,99.9,98.2,104.5,100.8,101.5,103.9,99.6,98.4,112.7,118.4,108.1,105.4,114.6,106.9,115.9,109.8,101.8,114.2,110.8,108.4,127.5,128.6,116.6,127.4,105,108.3,125,111.6,106.5,130.3,115,116.1,134,126.5,125.8,136.4,114.9,110.9,125.5,116.8,116.8,125.5,104.2,115.1,132.8,123.3,124.8,122,117.4,117.9,137.4,114.6,124.7,129.6,109.4,120.9,134.9,136.3,133.2,127.2,122.7,120.5,137.8,119.1,124.3,134.4,121.1,122.2,127.7,137.4,132.2,129.2,124.9,124.8,128.2,134.4,118.6,132.6,123.2,112.8,138.3) > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '-0.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/1y3581229679848.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/29d6r1229679848.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.38660425 -0.31647852 0.44676820 -0.31878347 -0.10495404 [7] 0.42341986 -0.24262096 -0.18155740 0.40463594 -0.36240340 -0.14819188 [13] 0.59772697 -0.24795817 -0.19591928 0.34044948 -0.30801198 -0.02626620 [19] 0.33850984 -0.23749853 -0.09221575 0.26925037 -0.28814424 -0.03414166 [25] 0.34760811 -0.11674938 -0.12812909 0.23390244 -0.23873264 -0.05172942 [31] 0.26916374 -0.15363862 -0.04323778 0.15026321 -0.19624944 -0.06787021 [37] 0.30989923 -0.08673917 -0.10859831 0.16231606 -0.13915345 -0.05955146 [43] 0.17453402 -0.05649045 -0.05602305 0.07559910 -0.11326357 -0.08578559 [49] 0.27418942 -0.08358195 -0.09859167 0.10688659 -0.06546962 -0.03285273 [55] 0.09392456 -0.01027759 -0.07435596 0.10778217 -0.12837263 -0.07543456 [61] 0.22798455 > (mypacf <- c(rpacf$acf)) [1] -0.3866042496 -0.5478201228 0.0766016366 -0.3370108216 -0.2662102099 [6] 0.0206151662 -0.0209668170 -0.2102312698 0.0864682088 -0.2949890182 [11] -0.4380897542 0.0017446673 0.1541227999 0.0546500360 0.0587169441 [16] -0.0164010283 0.0458760975 -0.0638002970 0.0374660383 -0.0336268776 [21] -0.0716263702 -0.1244750605 -0.0346272410 -0.1650458576 0.0945425541 [26] -0.0266536811 0.1502504092 0.0004624541 0.0033483132 -0.1519190377 [31] 0.0037166871 -0.0196516425 0.0615738574 -0.0427624457 -0.0812167842 [36] -0.0256165185 0.0532228811 -0.0383806440 -0.0285590953 -0.0095275914 [41] 0.1090990865 -0.0714498569 0.0942371643 0.0185232120 0.0094631972 [46] -0.0515050499 0.0143093982 0.0462452914 -0.0580990638 -0.0955210709 [51] -0.1402788994 -0.0976424602 0.0157713293 -0.0319731602 0.0072401138 [56] -0.0763363289 0.0895889525 -0.0727238269 -0.0483906760 -0.0325286087 > 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/3c8di1229679848.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/4079g1229679848.tab") > > system("convert tmp/1y3581229679848.ps tmp/1y3581229679848.png") > system("convert tmp/29d6r1229679848.ps tmp/29d6r1229679848.png") > > > proc.time() user system elapsed 1.538 0.560 1.642