R version 2.10.1 (2009-12-14) 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(254,234,222,225,243,270,289,273,274,220,271,288,276,266,239,201,242,239,273,280,294,212,264,272,262,238,227,250,245,270,288,298,281,218,284,281,277,276,222,255,267,261,263,264,278,248,320,305,301,274,220,235,252,272,280,305,299,246,307,325,302,274,251,272,253,292,288,258,295,231,250,268) > 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/rcomp/tmp/1lhwq1273075317.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/2lhwq1273075317.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.342786779 0.058229414 -0.133101282 -0.174183529 [6] 0.046839486 0.092559230 0.129886812 -0.083380625 -0.132764388 [11] -0.024157574 0.122417590 0.549685112 0.183760006 -0.002905199 [16] -0.134260480 -0.074506292 0.102605808 0.046206962 0.079732200 [21] -0.129368703 -0.165154141 -0.084351763 0.060182917 0.359851871 [26] 0.075511363 0.002886779 -0.113214741 -0.020809600 0.084825396 [31] -0.067970609 -0.089232273 -0.211316467 -0.199009748 -0.071240140 [36] 0.057575513 0.251654033 0.007606332 -0.100401437 -0.134024460 [41] -0.067329792 0.021129949 -0.023504093 -0.088239750 -0.216578826 [46] -0.181256967 -0.094111200 0.011926224 0.171930452 > (mypacf <- c(rpacf$acf)) [1] 0.342786779 -0.067165493 -0.149546211 -0.087140930 0.166022433 [6] 0.015557501 0.051732112 -0.175059411 -0.012361005 0.088732580 [11] 0.132032717 0.486585636 -0.251235074 -0.029468675 0.017985581 [16] 0.201622759 0.008192753 -0.174082140 -0.037438233 -0.027966632 [21] 0.053297208 -0.076301094 0.026161576 0.009317373 -0.077847775 [26] 0.105121359 -0.004842428 0.050477273 -0.128159973 -0.140329314 [31] -0.116602705 0.054205393 -0.051725706 -0.007416663 -0.049795562 [36] -0.011039112 0.037137882 -0.114249439 0.065930974 -0.167260122 [41] -0.040556917 0.116850084 -0.034086419 -0.088280272 -0.081722376 [46] 0.032068213 0.007425171 0.059078195 > 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/37ive1273075317.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/4aibk1273075317.tab") > > try(system("convert tmp/1lhwq1273075317.ps tmp/1lhwq1273075317.png",intern=TRUE)) character(0) > try(system("convert tmp/2lhwq1273075317.ps tmp/2lhwq1273075317.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.780 0.550 1.132