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(40.22,44.23,45.85,53.38,53.26,51.8,55.3,57.81,63.96,63.77,59.15,56.12,57.42,63.52,61.71,63.01,68.18,72.03,69.75,74.41,74.33,64.24,60.03,59.44,62.5,55.04,58.34,61.92,67.65,67.68,70.3,75.26,71.44,76.36,81.71,92.6,90.6,92.23,94.09,102.79,109.65,124.05,132.69,135.81,116.07,101.42,75.73,55.48,43.8,45.29,44.01,47.48,51.07,57.84,69.04,65.61,72.87,68.41,73.25,77.43) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '-0.6' > 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/1co6h1261917982.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/21o1k1261917982.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.4396969104 0.3196159374 0.0739288801 0.0009358011 [6] -0.1715807406 -0.3377560960 -0.1669421592 -0.2367693597 -0.1437212823 [11] -0.0478597037 0.0523680590 -0.0707503555 -0.0996987191 -0.0330239572 [16] 0.0082948378 -0.0197277388 -0.1016125986 -0.0622378176 -0.0692254575 [21] -0.1014022616 0.0306924237 0.0293652541 0.1661315215 0.0333514907 [26] 0.2284959275 0.1751588586 0.1159540815 -0.0052323952 -0.0935649766 [31] -0.0278420972 -0.1573404497 -0.0104504668 -0.0454088692 0.0243305701 [36] 0.0038556589 0.0917373902 0.0896246604 0.0237978986 -0.0279074778 [41] -0.0581022788 -0.0472122328 -0.0815479793 -0.0812540645 -0.1545352802 [46] -0.1220189443 -0.0299552304 -0.0613215604 0.0339144935 -0.0202795345 [51] 0.0723826968 0.0696138054 0.0282566392 0.0590093393 -0.0336086240 [56] 0.0285168723 0.0002298050 0.0128764813 0.0077544146 > (mypacf <- c(rpacf$acf)) [1] 0.4396969104 0.1565486412 -0.1441595880 -0.0413821862 -0.1677587701 [6] -0.2671227225 0.1648198601 -0.1259384621 -0.0595885676 0.1270457491 [11] -0.0293510853 -0.2793866925 -0.0256026231 0.0096388859 0.0070311102 [16] 0.0221518481 -0.1755525858 -0.1429784401 0.0193352985 -0.1455315458 [21] 0.1224101237 0.0178983768 0.0928065650 -0.1613682637 0.1545084582 [26] -0.0548428421 -0.0006045942 -0.0373318372 -0.0650974710 0.0182695511 [31] 0.0109418418 0.0524883243 0.0045474856 -0.0046761581 0.0362446285 [36] 0.0394795922 -0.0255391548 0.0392541385 -0.0189335943 -0.0458995738 [41] 0.0146548834 0.0031479629 -0.0321228790 -0.1498011462 0.0496526647 [46] 0.0365759328 -0.1303630759 0.0163398174 -0.0570151126 -0.0160844995 [51] 0.0473719446 -0.1085158751 -0.0781250353 0.1054550941 -0.0484751297 [56] 0.0205482793 -0.0948768432 -0.0395980120 > 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/34yey1261917982.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/4j9qk1261917982.tab") > > try(system("convert tmp/1co6h1261917982.ps tmp/1co6h1261917982.png",intern=TRUE)) character(0) > try(system("convert tmp/21o1k1261917982.ps tmp/21o1k1261917982.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.588 0.318 0.720