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(73,72,71,69,89,88,73,63,64,64,65,67,69,71,70,72,88,83,76,70,75,71,75,81,87,90,80,85,105,104,98,94,107,112,121,118,120,122,109,112,132,127,116,113,123,125,137,127,123,128,114,120,143,135,119,117,132,139,158,141,139,150,142,149,166,150,139,140,158,169,186,177,175,187,176,185,204,188,171,171,182,185,200,192,185,195,190,195,213,194,171,171,186,182,193,185,172,185,179,182,193,173,155,164,188,186,200,185,173,190,190,193,195,178,163,165,188,182,200,177) > 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/1mg7p1280844623.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/2ktdz1280844623.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.95655718 0.91262852 0.89292614 0.87751417 0.87968854 [7] 0.87821039 0.84612426 0.80675367 0.78133915 0.75803102 0.75420252 [13] 0.75330471 0.69947555 0.65001122 0.62588397 0.60660605 0.59794923 [19] 0.58558677 0.54800193 0.50642621 0.48212952 0.45809149 0.44805434 [25] 0.43989464 0.38955292 0.34633149 0.32612267 0.31086409 0.30036408 [31] 0.28455197 0.24609863 0.20613880 0.18691118 0.17066032 0.16351796 [37] 0.15435117 0.11017824 0.07284791 0.05619297 0.04347530 0.03264832 [43] 0.01532806 -0.02152761 -0.05885949 -0.07711645 -0.09289565 -0.10286324 [49] -0.11747047 > (mypacf <- c(rpacf$acf)) [1] 0.9565571815 -0.0279196298 0.2623057405 0.0372228938 0.2961404805 [6] -0.0148375347 -0.2385819036 -0.1224653080 0.0252332130 -0.0865127613 [11] 0.1827304322 0.0235979539 -0.5065396940 0.1326246528 0.0929406510 [16] 0.0633612573 -0.0598091786 -0.0164209292 0.0022167466 0.0068016361 [21] 0.0357084004 -0.0818698332 0.0027822506 -0.0294046938 -0.1333398799 [26] 0.0669770410 -0.0214321317 0.0550549718 -0.0556590464 -0.0127708470 [31] -0.0395931707 -0.0003674277 0.0377474842 0.0266901772 -0.0209802668 [36] -0.0532412329 -0.0457500803 0.0099603725 -0.0367730729 -0.0361244372 [41] -0.0344051879 -0.0424295202 -0.0147695491 -0.0283936351 -0.0370310228 [46] -0.0133059477 -0.0116226496 -0.0389845922 > 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/35btm1280844623.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/4rcaa1280844623.tab") > > try(system("convert tmp/1mg7p1280844623.ps tmp/1mg7p1280844623.png",intern=TRUE)) character(0) > try(system("convert tmp/2ktdz1280844623.ps tmp/2ktdz1280844623.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.567 0.321 3.079