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(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,344,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,442,544,420,396,482,261,211,448,468,464,425) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > 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/html/rcomp/tmp/18q3z1292316651.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/html/rcomp/tmp/28q3z1292316651.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.198741876 -0.162152066 0.211306269 -0.034009447 [6] -0.058207379 0.146934570 -0.032285782 0.082994735 0.185444385 [11] -0.212378285 0.093289602 0.555230658 0.027632573 -0.183208408 [16] 0.034996823 -0.090138987 -0.068742845 -0.027828595 -0.093308289 [21] -0.039437100 0.007860995 -0.184306384 -0.016781095 0.371230720 [26] 0.052590111 -0.217443051 -0.074083692 -0.085300065 -0.159719422 [31] -0.086796786 -0.088072693 -0.109462167 -0.012412715 -0.137987471 [36] -0.041594052 0.297194633 0.011652587 -0.264504657 -0.042385677 [41] -0.075224148 -0.145330791 -0.009724140 -0.053904209 -0.080279773 [46] 0.069951245 -0.089813244 -0.052287643 0.261045962 > (mypacf <- c(rpacf$acf)) [1] 0.198741876 -0.209942790 0.318049898 -0.252741600 0.187930169 [6] -0.040894062 0.009521525 0.169414348 0.007168150 -0.211982441 [11] 0.341878012 0.341462832 -0.107143242 -0.155504789 -0.137832867 [16] 0.060936212 -0.048391876 -0.166637372 -0.006729993 -0.290384603 [21] 0.110974982 -0.035240622 0.012571743 0.182534512 -0.058745401 [26] 0.020254560 -0.075160029 0.016599797 -0.083740558 -0.052050566 [31] -0.083150201 -0.089842423 -0.026660194 -0.025722771 0.098004639 [36] -0.040430296 -0.049512405 -0.080862882 0.107700148 -0.035710299 [41] 0.020046627 -0.005548390 -0.060743342 0.052830477 0.059079903 [46] -0.023792597 -0.095301196 -0.071369650 > 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/34i1q1292316651.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/470ze1292316651.tab") > > try(system("convert tmp/18q3z1292316651.ps tmp/18q3z1292316651.png",intern=TRUE)) character(0) > try(system("convert tmp/28q3z1292316651.ps tmp/28q3z1292316651.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.587 0.337 27.254