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 = '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/html/rcomp/tmp/1g9wb1292946873.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/2g9wb1292946873.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.177150550 0.060138296 -0.192047668 -0.205836260 [6] 0.003082302 0.236405367 0.158102049 0.172703277 0.180895190 [11] -0.074365404 -0.255203742 -0.282860178 -0.076669175 0.126754761 [16] 0.224129457 0.010165329 -0.121614452 -0.122610422 -0.270078419 [21] -0.029663400 -0.149125656 0.006230426 0.149211971 -0.078051884 [26] -0.107666221 -0.197465395 -0.117794829 0.019457542 0.167797686 [31] -0.045258757 0.004700719 -0.026630970 0.010477371 0.007787554 [36] 0.080048101 -0.020872853 0.025439375 0.066551037 -0.017654492 [41] -0.029825252 -0.023487719 -0.004434579 0.009488009 0.039136321 [46] 0.010175618 0.003189420 > (mypacf <- c(rpacf$acf)) [1] 0.177150550 0.029687646 -0.214560686 -0.149039927 0.094815615 [6] 0.235670679 0.016099594 0.090924998 0.259002565 -0.047797031 [11] -0.300333676 -0.228831853 0.069256031 0.040594847 -0.085294248 [16] -0.135956133 0.042371724 0.143240526 -0.268767894 0.015476606 [21] -0.044373262 -0.056121802 -0.004028597 -0.287781220 0.035883627 [26] 0.043815814 0.016269543 -0.018462197 0.097400944 -0.034198236 [31] -0.043517048 -0.009353329 0.048579647 0.055302619 0.015702997 [36] -0.116913260 -0.083268223 -0.045751913 0.120894709 -0.129114750 [41] -0.166882414 0.028205998 -0.095956074 0.020895032 -0.050278317 [46] 0.054834037 > 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/31acz1292946873.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/4nab51292946873.tab") > > try(system("convert tmp/1g9wb1292946873.ps tmp/1g9wb1292946873.png",intern=TRUE)) character(0) > try(system("convert tmp/2g9wb1292946873.ps tmp/2g9wb1292946873.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.590 0.332 1.354