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(441,449,452,462,455,461,461,463,462,456,455,456,472,472,471,465,459,465,468,467,463,460,462,461,476,476,471,453,443,442,444,438,427,424,416,406,431,434,418,412,404,409,412,406,398,397,385,390,413,413,401,397,397,409,419,424,428,430,424,433,456) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '60' > #'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/1xbns1261222164.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/2l7ea1261222164.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.181873414 -0.220581088 -0.178471135 -0.086299077 [6] 0.198938813 0.367041097 0.201558028 -0.124912243 -0.237578981 [11] -0.291434898 0.231152455 0.603121456 -0.013460604 -0.243965005 [16] -0.193106335 -0.158719015 0.081803208 0.191364692 0.122549549 [21] -0.212237403 -0.254752390 -0.226035535 0.166185127 0.298698493 [26] -0.090308905 -0.239320624 -0.202503105 -0.164335476 0.008249176 [31] 0.092050548 0.053369876 -0.214505589 -0.163160879 -0.064346276 [36] 0.083666361 0.175082357 -0.036520495 -0.081303667 -0.097950532 [41] -0.033320732 0.018348005 0.079143490 0.016106821 -0.082086731 [46] -0.028257817 0.001647135 0.042244964 0.076740293 -0.019401091 [51] -0.007695631 -0.011219420 0.029270400 0.024666523 0.033293730 [56] 0.008708214 -0.017983475 0.042649997 0.028163309 0.038086623 > (mypacf <- c(rpacf$acf)) [1] 0.1818734136 -0.2623365795 -0.0889813751 -0.0970252191 0.1933258705 [6] 0.2748439676 0.1918350142 -0.0188075115 -0.0792468565 -0.3287205801 [11] 0.1963170028 0.4174275618 -0.2329951290 -0.0740123357 0.0085957731 [16] -0.0948743034 -0.1005900273 -0.2130791762 0.0683889380 -0.1278373216 [21] 0.0970407227 0.0228411080 -0.0890036294 -0.0536377267 0.0202367286 [26] -0.1516132055 -0.0622347761 -0.1127948231 -0.0004055607 -0.1579425421 [31] 0.0271895518 -0.0352359361 0.0992855721 0.0857773333 -0.0844375317 [36] -0.0159315828 0.0873557204 0.0607509906 0.0025291613 -0.0338500336 [41] 0.0061350899 -0.0824635722 -0.0981819993 0.0513823175 -0.1196231549 [46] -0.0621550921 0.0550944775 -0.1032822773 -0.0305607705 -0.0134162817 [51] 0.0508965207 -0.0404926794 -0.0085274074 0.0814482201 -0.0596382405 [56] -0.0776650215 0.0091858007 -0.0666857672 0.0336205435 > 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/375i61261222164.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/4bjv71261222164.tab") > > try(system("convert tmp/1xbns1261222164.ps tmp/1xbns1261222164.png",intern=TRUE)) character(0) > try(system("convert tmp/2l7ea1261222164.ps tmp/2l7ea1261222164.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.583 0.318 0.682