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(224,215,196,159,187,208,131,93,210,228,176,195,188,188,190,188,176,225,93,79,235,247,195,197,211,156,209,180,185,303,129,85,249,231,212,240,234,217,287,221,208,241,156,96,320,242,227,200,215,238,279,208,262,259,167,123,302,246,235) > par8 = '' > 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/1wezx1292946627.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/2wezx1292946627.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.000000e+00 1.114995e-01 -2.416361e-01 1.596921e-01 9.817416e-02 [6] 5.519556e-05 2.151427e-01 -2.697755e-02 1.083036e-01 1.442782e-01 [11] -2.626248e-01 5.733677e-02 6.847974e-01 1.551039e-03 -2.298361e-01 [16] 1.402983e-01 2.367762e-02 -1.625110e-02 6.293458e-02 -1.566113e-01 [21] 8.088005e-03 4.907501e-02 -2.522689e-01 3.213004e-02 3.888201e-01 [26] -9.548742e-02 -3.012843e-01 9.501336e-03 -1.657681e-02 -5.216289e-03 [31] -5.738275e-02 -1.869610e-01 -7.793463e-02 -6.492053e-02 -2.084955e-01 [36] -3.499086e-03 1.967468e-01 -5.961245e-02 -1.914655e-01 -4.644545e-02 [41] -2.371092e-02 -3.316300e-02 -7.506995e-02 -8.506852e-02 -1.420992e-02 [46] -4.086543e-02 -1.125118e-01 -1.756229e-02 6.995365e-02 > (mypacf <- c(rpacf$acf)) [1] 0.111499473 -0.257266615 0.240999449 -0.036048252 0.105498732 [6] 0.206009702 -0.121663704 0.299397436 -0.089145755 -0.231300677 [11] 0.236569913 0.528259279 -0.174209118 -0.011923110 -0.005972159 [16] -0.084153370 -0.002009346 -0.241131984 -0.100062899 -0.154986606 [21] -0.107753328 0.108001396 -0.030370159 -0.072233091 0.069793282 [26] -0.228712306 -0.027693247 0.014622702 -0.022087002 -0.028936774 [31] 0.043682377 -0.091417982 -0.017656565 0.063210377 -0.109626190 [36] 0.035117108 0.041324541 0.187843047 -0.013656704 -0.053039555 [41] -0.018285502 0.020974698 0.061995858 0.076866961 0.030406279 [46] -0.081596475 0.022638598 -0.083956572 > 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/3sp0y1292946628.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/4v8g41292946628.tab") > > try(system("convert tmp/1wezx1292946627.ps tmp/1wezx1292946627.png",intern=TRUE)) character(0) > try(system("convert tmp/2wezx1292946627.ps tmp/2wezx1292946627.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.561 0.324 1.295