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(4.23,4.38,4.43,4.44,4.44,4.44,4.44,4.44,4.45,4.45,4.45,4.45,4.45,4.45,4.45,4.45,4.46,4.46,4.46,4.48,4.58,4.67,4.68,4.68,4.69,4.69,4.69,4.69,4.69,4.69,4.69,4.73,4.78,4.79,4.79,4.8,4.8,4.81,5.16,5.26,5.29,5.29,5.29,5.3,5.3,5.3,5.3,5.3,5.3,5.3,5.3,5.35,5.44,5.47,5.47,5.48,5.48,5.48,5.48,5.48,5.48,5.48,5.5,5.55,5.57,5.58,5.58,5.58,5.59,5.59,5.59,5.55) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/16nru1290103006.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/26nru1290103006.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.0000000000 0.2898932818 -0.0175658017 -0.0902981450 -0.0998335826 [6] -0.0771151321 -0.0222237114 -0.0162471813 -0.1029297762 -0.1150869549 [11] -0.0844870977 -0.0341918156 -0.0160695037 0.0514612981 0.0960114069 [16] -0.0478801667 -0.0947592304 0.0910412223 0.1614446108 0.0866650437 [21] 0.0182213509 -0.0647552027 -0.0702690191 -0.0665096403 -0.0323817612 [26] 0.0012525184 -0.0679518030 -0.0923437731 -0.1104160527 -0.0940982107 [31] 0.0061800786 0.0216806495 -0.0361061516 -0.1464167830 -0.0518432079 [36] -0.0367553185 0.0503090723 0.2647544733 0.0577064530 -0.0083663444 [41] -0.0259369328 -0.0006695674 0.0277940563 0.0245783093 0.0059315124 [46] -0.0144388364 -0.0233188388 -0.0218575293 -0.0193281031 > (mypacf <- c(rpacf$acf)) [1] 0.289893282 -0.110925922 -0.058013596 -0.062260228 -0.041685353 [6] -0.001025534 -0.029203519 -0.116067154 -0.070339534 -0.055394022 [11] -0.027097433 -0.042254770 0.031560433 0.047891548 -0.119598672 [16] -0.065666884 0.139617254 0.083822969 -0.003246853 -0.013212511 [21] -0.047205956 0.013513154 -0.036235012 -0.029304906 0.010345846 [26] -0.071555810 -0.059548605 -0.089154424 -0.048845983 0.023642205 [31] -0.095101327 -0.115956375 -0.152541923 -0.003266268 -0.114694227 [36] -0.032740035 0.198643322 -0.153999361 -0.014295212 -0.005350839 [41] 0.017280566 0.030300574 -0.036974540 -0.022950815 0.046437926 [46] 0.053612942 0.007421616 -0.058268068 > 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/3kx6k1290103006.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/4vo651290103006.tab") > > try(system("convert tmp/16nru1290103006.ps tmp/16nru1290103006.png",intern=TRUE)) character(0) > try(system("convert tmp/26nru1290103006.ps tmp/26nru1290103006.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.575 0.313 1.220