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(106.7,110.2,125.9,100.1,106.4,114.8,81.3,87,104.2,108,105,94.5,92,95.9,108.8,103.4,102.1,110.1,83.2,82.7,106.8,113.7,102.5,96.6,92.1,95.6,102.3,98.6,98.2,104.5,84,73.8,103.9,106,97.2,102.6,89,93.8,116.7,106.8,98.5,118.7,90,91.9,113.3,113.1,104.1,108.7,96.7,101,116.9,105.8,99,129.4,83,88.9,115.9,104.2,113.4,112.2,100.8,107.3,126.6,102.9,117.9,128.8,87.5,93.8,122.7,126.2,124.6,116.7,115.2,111.1,129.9,113.3,118.5,137.9,103.6,101.7,127.4,137.5,128.3,118.2,117.1,124.2,126,132.1) > par5 = '12' > par4 = '1' > par3 = '1' > 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/16w331228846017.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/2slkt1228846017.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.569950586 0.031237572 0.239259214 -0.223217505 [6] 0.036848294 0.168423825 -0.250650694 0.116795842 0.008917023 [11] -0.051161574 0.097393000 -0.124986239 0.026047836 -0.033114278 [16] 0.051971235 -0.107046351 0.091684711 -0.041811814 -0.012018071 [21] 0.037359855 0.145459032 -0.342853943 0.398668367 -0.227887597 [26] -0.031564212 0.216160531 -0.169476688 0.019830029 0.127601930 [31] -0.129126919 0.020408934 0.123263017 -0.225216936 0.169016056 [36] -0.043561482 -0.078899869 0.072427108 -0.019883359 -0.078936199 [41] 0.104689640 -0.040553573 -0.065207161 0.055091509 0.045373025 [46] -0.135557127 0.124027313 -0.012425680 -0.112735304 0.169832599 [51] -0.087107442 0.010850237 0.014040052 -0.022042503 0.058256650 [56] 0.004210807 -0.108686429 0.119296642 -0.050886662 -0.041376683 [61] 0.081711742 > (mypacf <- c(rpacf$acf)) [1] -0.5699505864 -0.4348712822 0.0309609071 -0.0006065689 -0.0839928532 [6] 0.1148284671 -0.0607469177 -0.0955468993 -0.1049302780 0.0038862786 [11] 0.1227328693 -0.0603859596 -0.1047512399 -0.2368168901 -0.0754033511 [16] -0.1814722892 -0.0762680175 -0.0166823938 -0.0409815315 -0.0709798598 [21] 0.2346808649 -0.1655306392 0.1622365650 0.0004276739 -0.0281594788 [26] 0.0104697344 0.0292308426 0.0604188170 -0.0033231092 0.0455197628 [31] -0.0543720484 0.0906353436 -0.0154969820 -0.0030029954 0.1095253942 [36] -0.0209450272 0.0070674453 -0.0835829304 -0.0259934088 -0.0692595169 [41] 0.0435040497 -0.0744895770 -0.0542365880 -0.0337057377 -0.0195555398 [46] -0.1123647115 -0.0138816915 -0.0676645519 -0.0560326466 -0.0388588959 [51] 0.0158924560 -0.0977752607 -0.1389569486 0.1067395071 -0.0144468811 [56] -0.0412987057 -0.0239591536 -0.0551210909 -0.0037824123 -0.0836073936 > 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/347ar1228846017.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/4wuow1228846017.tab") > system("convert tmp/16w331228846017.ps tmp/16w331228846017.png") > system("convert tmp/2slkt1228846017.ps tmp/2slkt1228846017.png") > > > proc.time() user system elapsed 0.590 0.326 0.709