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(568,567,566,564,584,583,568,558,559,559,560,562,563,552,552,555,575,567,548,541,544,546,551,550,546,532,523,528,555,543,525,517,519,521,520,516,509,494,484,482,508,500,480,467,471,482,481,477,471,455,441,434,459,448,432,414,415,423,425,427,415,399,386,377,397,379,361,350,348,363,367,365,354,327,312,307,335,317,298,286,288,303,310,301,293,264,255,251,279,253,233,226,232,245,250,242,230,196,188,181,212,186,166,155,157,173,182,182,168,131,114,106,134,103,83,74,83,96,95,100) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/1vf0p1281795204.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/2vf0p1281795204.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.00000000 0.14074273 -0.28361315 -0.51524278 -0.08375573 0.23360934 [7] 0.27257304 0.20410668 -0.11942473 -0.48970672 -0.26595317 0.13656487 [13] 0.84433941 0.10172098 -0.25323596 -0.44752204 -0.06951224 0.20977895 [19] 0.24895770 0.18092489 -0.10918134 -0.43140753 -0.24493335 0.13212952 [25] 0.70930080 0.07265134 -0.24079885 -0.37840479 -0.06513569 0.19347318 [31] 0.21679096 0.15334612 -0.10849891 -0.38262385 -0.19726200 0.13512407 [37] 0.58784082 0.03755099 -0.23157687 -0.30187826 -0.04808044 0.17556997 [43] 0.17306589 0.12163050 -0.08775259 -0.32662494 -0.16232740 0.12188179 [49] 0.47640820 > (mypacf <- c(rpacf$acf)) [1] 0.1407427310 -0.3095534612 -0.4732241549 -0.0882851616 -0.0179232153 [6] -0.0204918048 0.2547175347 0.0639175604 -0.3995904478 -0.1557671468 [11] -0.1041050835 0.7028698315 -0.1460663502 0.1458737007 0.2143833821 [16] -0.0973429614 -0.0478052042 0.0033124720 -0.0765364860 0.0586318319 [21] 0.0622259740 -0.0241305493 0.0796500725 0.0057074078 -0.0364886513 [26] -0.0547004158 0.0380702856 -0.0787795740 0.0276705762 -0.0050322550 [31] -0.0410709334 -0.0141828668 -0.0214897384 0.0558769030 -0.0092377964 [36] -0.0301711140 0.0014506842 -0.0386185756 0.0246014803 0.0125210697 [41] -0.0399614173 -0.0007505829 -0.0063011628 0.0437651650 0.0006205052 [46] -0.0259213382 -0.0027469658 -0.0474028361 > 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/3ygyd1281795204.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/4kgx11281795204.tab") > > try(system("convert tmp/1vf0p1281795204.ps tmp/1vf0p1281795204.png",intern=TRUE)) character(0) > try(system("convert tmp/2vf0p1281795204.ps tmp/2vf0p1281795204.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.560 0.318 3.101