R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(320,324,343,295,301,367,196,182,342,361,333,330,345,323,365,323,316,358,235,169,430,409,407,341,326,374,364,349,300,385,304,196,443,414,325,388,356,386,444,387,327,448,225,182,460,411,342,361,377,331,428,340,352,461,221,198,422,329,320,375,364,351,380,319,322,386,221,187,343,342,365,313,356,337,389,326,343,357,220,218,391,425,332,298,360,336,325,393,301,426,265,210,429,440,357,431,442,422,544,420,396,482,261,211,448,468,464,425) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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/1mzmg1292962920.ps",horizontal=F,onefile=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/2mzmg1292962920.ps",horizontal=F,onefile=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.220102490 0.298087521 0.302579502 0.009203384 [6] 0.186853086 0.246959059 0.044780320 0.323203333 0.183101695 [11] 0.022410184 0.219175764 -0.150688329 -0.039244610 0.094034987 [16] 0.143218070 0.013827989 0.174726072 0.028221108 0.018011584 [21] 0.054334754 -0.013283041 -0.056077221 0.035178489 -0.137102038 [26] -0.037978573 0.032662418 -0.267304798 -0.027206259 -0.087304712 [31] -0.206390242 -0.070814927 -0.151812589 -0.245923097 -0.071326958 [36] -0.153525026 -0.169495977 -0.049334842 -0.225042620 -0.087937287 [41] -0.090597101 -0.161647335 -0.156021251 -0.066338731 -0.115350797 [46] -0.098853087 -0.097618482 -0.212346375 -0.123453590 > (mypacf <- c(rpacf$acf)) [1] 0.220102490 0.262352090 0.221698379 -0.164501953 0.086387544 [6] 0.226219059 -0.049305380 0.182797368 0.064461103 -0.125236387 [11] 0.048724495 -0.246457327 -0.049204638 0.064613915 0.326281632 [16] -0.218008580 0.005573574 0.127037904 -0.062105170 -0.000357145 [21] 0.065176450 -0.144918500 -0.076694334 -0.180026260 -0.020961941 [26] 0.018365913 -0.056312467 -0.026970743 -0.020723936 -0.026707695 [31] -0.042058005 -0.049784282 -0.024366211 -0.078389888 0.109157076 [36] -0.192057735 -0.004416345 0.004338210 0.082742632 -0.088826293 [41] 0.049259590 -0.030006574 -0.033133731 0.103622734 -0.061468424 [46] -0.162404305 -0.033691090 0.007201522 > 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/3i9271292962920.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/4tija1292962920.tab") > > try(system("convert tmp/1mzmg1292962920.ps tmp/1mzmg1292962920.png",intern=TRUE)) character(0) > try(system("convert tmp/2mzmg1292962920.ps tmp/2mzmg1292962920.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.600 0.430 1.013