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(268,267,266,264,262,261,262,264,265,265,266,268,260,264,265,262,258,265,273,273,270,263,260,257,248,248,237,228,225,231,243,250,246,240,236,235,225,230,225,221,231,234,249,257,253,252,245,239,229,232,222,218,223,221,230,234,237,226,215,211,203,202,187,179,181,172,182,180,175,163,160,151,145,140,125,122,124,108,115,116,104,98,101,91) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > 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: > 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/1qxka1278601689.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/2qxka1278601689.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.157984229 0.112732531 0.124276075 -0.178239812 [6] -0.082656884 -0.058325484 -0.074194296 -0.189863308 0.029210825 [11] 0.088280563 0.193949590 0.643098698 0.058439807 0.111642580 [16] -0.011894825 -0.234532103 -0.113778556 -0.147667087 -0.134376154 [21] -0.173245941 -0.008711583 0.016316712 0.159920183 0.381517556 [26] 0.036453298 0.098959451 -0.024104203 -0.255914406 -0.051008188 [31] -0.072757697 -0.113278747 -0.133418187 0.010981735 -0.034805509 [36] 0.089480576 0.248504999 0.011033809 0.037545152 -0.030522141 [41] -0.224377303 0.029500395 -0.039318721 -0.098587283 -0.067341858 [46] -0.004337923 -0.021991885 0.061376495 0.094743502 0.003901811 [51] -0.004558627 -0.051066797 -0.114516730 0.044133498 -0.067656245 [56] -0.063345992 -0.033583616 -0.009334607 -0.035728939 0.005866924 [61] -0.023850534 > (mypacf <- c(rpacf$acf)) [1] 0.157984229 0.090020333 0.097036230 -0.228516394 -0.049082292 [6] -0.013580160 0.001035542 -0.214439039 0.086948879 0.120226915 [11] 0.221815714 0.576995589 -0.177562753 -0.026799158 -0.224254353 [16] -0.080299642 -0.079821208 -0.074385992 -0.022369572 0.056340926 [21] 0.030812444 -0.094804413 -0.055152066 -0.086763588 0.071018282 [26] 0.014459786 0.140394127 -0.110379300 0.166862907 0.119672227 [31] 0.031344265 -0.158859609 -0.055072501 -0.082517241 -0.056668562 [36] -0.035213720 -0.077595793 0.012274878 0.033524210 -0.007564299 [41] 0.033006767 -0.005307506 -0.041080241 0.042246518 0.018757362 [46] 0.118016979 0.013742109 -0.115730963 0.028701450 -0.073841509 [51] -0.025100214 -0.013637107 -0.083460266 -0.068241513 -0.013776364 [56] -0.076529343 0.066339888 -0.054881644 0.002885017 -0.085589801 > 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/3by0g1278601689.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/4xgzm1278601689.tab") > > try(system("convert tmp/1qxka1278601689.ps tmp/1qxka1278601689.png",intern=TRUE)) character(0) > try(system("convert tmp/2qxka1278601689.ps tmp/2qxka1278601689.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.587 0.304 1.648