R version 2.11.1 (2010-05-31) Copyright (C) 2010 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(356,355,354,352,372,371,356,346,347,347,348,350,353,351,348,351,370,370,351,335,330,328,332,334,343,334,336,343,365,364,351,326,320,312,315,316,319,311,315,322,336,339,317,295,291,283,285,289,296,283,285,289,306,306,283,258,255,248,244,249,258,252,246,249,267,284,261,235,229,218,218,229,237,231,229,233,245,256,224,194,192,178,170,187,192,182,178,186,204,224,194,173,178,168,152,163,172,170,156,155,178,194,164,135,139,135,109,121,131,135,119,121,151,169,135,105,112,105,82,81) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '2' > par3 = '0' > par2 = '1' > par1 = '48' > #'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/rcomp/tmp/1zykb1282205953.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/rcomp/tmp/2zykb1282205953.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.8705570490 0.7329165666 0.5626642806 0.4079953857 [6] 0.2196368507 0.0136257770 -0.1689408138 -0.3137976185 -0.4194319765 [11] -0.5535767371 -0.6208850886 -0.6677826236 -0.5624508947 -0.4667718205 [16] -0.3331897051 -0.1823806514 -0.0226418930 0.1103055550 0.1960306723 [21] 0.2717131109 0.3306684393 0.3958382379 0.3731191161 0.3553930041 [26] 0.2960173366 0.2611578394 0.1725259802 0.0560768015 -0.0576070719 [31] -0.1321813772 -0.1713465108 -0.2126422823 -0.2311668893 -0.2385661498 [36] -0.1810707760 -0.1475609994 -0.1007693247 -0.0881785378 -0.0355971150 [41] 0.0242818852 0.0808021989 0.1325021148 0.1577954737 0.1695043145 [46] 0.1438222401 0.1056378763 0.0379320341 -0.0009383854 > (mypacf <- c(rpacf$acf)) [1] 0.870557049 -0.103056066 -0.214643261 -0.037392575 -0.244738411 [6] -0.253614102 -0.068118184 -0.042231517 -0.042163248 -0.332121753 [11] 0.024798516 -0.139994461 0.442316248 -0.092938068 0.102253912 [16] 0.104054654 -0.094140078 -0.188715092 -0.090457573 0.019383513 [21] 0.092683647 -0.081510611 -0.106272700 0.047311865 0.203333249 [26] 0.104631947 -0.055248050 -0.019789460 -0.121527499 -0.062195121 [31] -0.017801227 0.096143445 0.061695075 0.018009394 -0.010420797 [36] 0.050080159 0.073171410 -0.126936586 -0.017633934 0.013435882 [41] -0.002275938 0.074864492 -0.079504812 -0.048535568 0.013374343 [46] -0.091658063 -0.001390272 -0.011755290 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3vq0j1282205953.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/rcomp/tmp/4gqg71282205953.tab") > > try(system("convert tmp/1zykb1282205953.ps tmp/1zykb1282205953.png",intern=TRUE)) character(0) > try(system("convert tmp/2zykb1282205953.ps tmp/2zykb1282205953.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.800 0.510 1.302