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(349,348,347,345,365,364,349,339,340,340,341,343,341,343,341,335,355,357,337,325,336,338,337,328,326,327,319,310,320,322,303,292,303,315,311,307,308,312,309,310,309,304,287,275,290,298,294,286,294,292,287,281,280,271,264,259,271,279,279,273,286,286,280,277,269,255,252,245,257,267,261,258,271,262,258,253,236,228,235,226,231,235,227,222,233,221,218,220,204,196,208,190,191,194,179,162,179,176,168,170,153,142,155,136,136,144,135,114,135,132,123,123,103,97,113,108,111,121,111,97) > 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/17a331281887308.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/27a331281887308.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.083520901 -0.405411270 0.186442484 -0.026503525 [6] -0.221066411 0.247225675 -0.190760800 -0.049643141 0.222953205 [11] -0.288967665 -0.095915898 0.757133447 -0.075041340 -0.424822963 [16] 0.121141805 0.076044327 -0.156116146 0.168034425 -0.124241445 [21] -0.082196648 0.142528705 -0.135300530 -0.070914101 0.509724792 [26] -0.044600033 -0.343427539 0.063917808 0.127302222 -0.107209132 [31] 0.066628171 -0.115249866 -0.066290064 0.094025542 -0.021438717 [36] -0.018312845 0.303943807 -0.063543752 -0.250283213 -0.002918927 [41] 0.120911218 -0.046140299 -0.002928319 -0.108421979 0.009296977 [46] 0.082596935 0.032753650 -0.015305828 0.144745510 -0.050577146 [51] -0.163189517 -0.063319643 0.131471887 0.026027778 -0.062354548 [56] -0.068461528 0.036556061 0.052366783 0.084209746 -0.026772974 [61] 0.012298812 > (mypacf <- c(rpacf$acf)) [1] -0.0835209008 -0.4152839238 0.1263566108 -0.2052818673 -0.1336820042 [6] 0.1503980836 -0.3842962407 0.2233239361 -0.1575916866 -0.3138704526 [11] 0.1355384755 0.5654759175 0.0444675819 -0.0124279806 -0.1086888885 [16] 0.2060214252 0.0655087721 -0.0475041652 0.0867924080 -0.1092753899 [21] -0.0989704990 0.1116659425 0.0300806619 -0.0554378783 -0.0525030447 [26] 0.1264304485 0.0360530037 -0.0541752719 0.0203637780 -0.0278891327 [31] -0.1252325762 0.0160163426 0.0110420346 0.0246566340 -0.0151612728 [36] -0.0329343994 -0.0083762048 -0.0536026792 -0.0844355261 -0.0047144192 [41] -0.0514829876 -0.0435905777 -0.0293551847 0.0633423284 0.0403906014 [46] 0.0278529560 -0.0543930629 0.0244217724 0.0905107801 -0.0394485673 [51] -0.0765974102 0.0500846983 0.0426022678 -0.0354246103 0.1280523248 [56] -0.0614618530 -0.0038372246 0.0815781867 0.0456539569 -0.0005093435 > 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/33j1b1281887308.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/4dbiw1281887308.tab") > > try(system("convert tmp/17a331281887308.ps tmp/17a331281887308.png",intern=TRUE)) character(0) > try(system("convert tmp/27a331281887308.ps tmp/27a331281887308.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.601 0.303 0.758