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(210,220,212,191,180,195,136,196,182,166,147,125,164,170,171,140,155,156,141,167,171,206,187,124,163,154,226,125,162,145,98,128,159,209,150,125,214,193,140,205,192,192,186,150,246,282,264,336,301,376,416,344,326,351,249,258,311,343,278) > 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/1b84k1261316988.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/23ody1261316988.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.318821870 -0.170348512 0.152941074 -0.054022488 [6] 0.077995337 -0.104743715 0.002159890 0.166314793 -0.165461937 [11] -0.131707467 0.090630551 0.067980719 0.038661247 0.016760262 [16] -0.178540747 0.085738721 0.044095700 -0.116362145 0.046132997 [21] 0.013351929 0.117634572 -0.307711592 0.038717405 0.198842109 [26] 0.021647610 -0.103568111 -0.023443940 0.056606618 0.029299217 [31] -0.141159907 0.129235442 0.054963080 -0.084932391 -0.061907750 [36] 0.019503274 -0.004839036 0.080443450 -0.058038846 -0.051348869 [41] 0.058488929 -0.084319833 0.004248549 0.030234648 -0.020772587 [46] 0.033334325 -0.021444103 -0.077591174 0.080545998 0.026081407 [51] 0.000567662 -0.028345578 0.041819119 -0.030061904 -0.002497836 [56] 0.014424557 0.007722848 -0.005131699 > (mypacf <- c(rpacf$acf)) [1] -0.318821870 -0.302771865 -0.017578239 -0.058975222 0.097685877 [6] -0.074674006 -0.027337087 0.124733254 -0.053584354 -0.200245761 [11] -0.118784695 0.019299334 0.118980543 0.177221038 -0.130550058 [16] -0.094023239 -0.010606931 -0.044322618 -0.066743542 -0.065034292 [21] 0.159346754 -0.222240905 -0.043009198 0.018198426 0.139102228 [26] -0.018056012 -0.017727687 -0.067474057 0.034687932 -0.056269599 [31] 0.064709235 -0.012604640 -0.032707617 -0.021810895 0.020308307 [36] -0.039606676 -0.055337855 -0.058132637 -0.037238452 -0.003741982 [41] -0.074562833 -0.075333229 0.027312195 -0.102377961 -0.082102958 [46] 0.051387955 0.046904411 -0.061875519 -0.022066731 0.018805591 [51] 0.001481036 0.003889675 0.004281089 -0.019866138 0.012152192 [56] -0.062966570 -0.039345141 > 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/3ogam1261316988.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/4oxf11261316988.tab") > > try(system("convert tmp/1b84k1261316988.ps tmp/1b84k1261316988.png",intern=TRUE)) character(0) > try(system("convert tmp/23ody1261316988.ps tmp/23ody1261316988.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.60 0.33 0.75