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(13.4,13.5,14.8,14.3,14.3,14,13.2,12.2,14.3,15.7,14.2,14.6,14.5,14.3,15.3,14.4,13.7,14.2,13.5,11.9,14.6,15.6,14.1,14.9,14.2,14.6,17.2,15.4,14.3,17.5,14.5,14.4,16.6,16.7,16.6,16.9,15.7,16.4,18.4,16.9,16.5,18.3,15.1,15.7,18.1,16.8,18.9,19,18.1,17.8,21.5,17.1,18.7,19,16.4,16.9,18.6,19.3,19.4,17.6,18.6,18.1,20.4,18.1,19.6,19.9,19.2,17.8,19.2,22,21.1,19.5) > par7 = '0.95' > par6 = 'MA' > 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: > 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 (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > 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/1totp1262003735.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2vh651262003735.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.74428589 0.65749563 0.69846684 0.61167263 0.60789903 [7] 0.65867062 0.53182125 0.50276443 0.53302854 0.40391738 0.45447914 [13] 0.56668711 0.39249793 0.34686863 0.35126452 0.27208673 0.29565585 [19] 0.31868265 0.21499566 0.18484991 0.18228862 0.05059861 0.10939694 [25] 0.12205092 -0.01360423 -0.06339199 -0.06721043 -0.13081427 -0.10611104 [31] -0.09529203 -0.16000883 -0.16319278 -0.20117876 -0.26302081 -0.20326302 [37] -0.17875705 -0.25127356 -0.29236028 -0.29775006 -0.32155842 -0.30666524 [43] -0.29804060 -0.34036832 -0.32973941 -0.35863519 -0.39455342 -0.35749354 [49] -0.30741921 -0.33453489 -0.35894295 -0.33183840 -0.32621334 -0.28402479 [55] -0.25784059 -0.25968274 -0.25354513 -0.25370009 -0.24858111 -0.22603385 [61] -0.20119396 > (mypacf <- c(rpacf$acf)) [1] 0.7442858861 0.2321192966 0.3552790987 -0.0364989658 0.1673200575 [6] 0.1875532987 -0.1917953246 0.0125013409 0.0343613451 -0.2033948963 [11] 0.2144691207 0.2717876318 -0.3037192314 -0.0864540819 -0.1031033086 [16] 0.0236124924 0.0128429803 -0.0329322567 0.0464362071 -0.1380656391 [21] -0.0413286319 -0.0998380496 0.0632229703 -0.1459475910 -0.0884472186 [26] -0.1273458732 0.0580821177 0.0062850660 -0.0135285853 0.0231414581 [31] 0.0475068819 -0.0236960935 -0.1172295530 0.0886560153 -0.0361119874 [36] 0.0790493849 -0.0178076203 -0.0640628349 -0.0012790861 -0.0314039866 [41] -0.0418877441 0.0002905563 -0.0472366379 0.0274519204 0.0300328583 [46] -0.0829880875 0.0136281695 0.0109019869 0.0358907891 -0.0496269941 [51] 0.0670855729 0.0165772181 0.0496637616 -0.0192600501 0.0271575078 [56] -0.0228765618 -0.0395532341 0.0809989986 -0.0690623685 -0.1056309181 > 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/3hwpg1262003735.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/4ium21262003735.tab") > > try(system("convert tmp/1totp1262003735.ps tmp/1totp1262003735.png",intern=TRUE)) character(0) > try(system("convert tmp/2vh651262003735.ps tmp/2vh651262003735.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.571 0.347 2.562