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(31.48,29.90,33.84,39.12,33.70,25.09,51.44,45.59,52.52,48.56,41.75,49.59,32.75,33.38,35.65,37.03,35.68,20.97,58.55,54.96,65.54,51.57,51.15,46.64,35.70,33.25,35.19,41.67,34.87,21.21,56.13,49.23,59.72,48.10,47.47,50.50,40.06,34.15,36.86,46.36,36.58,23.87,57.28,56.39,57.66,62.30,48.93,51.17,39.64,33.21,38.13,43.29,30.60,21.96,48.03,46.15,50.74,48.11,38.39,44.11) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '36' > #'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/1a3tp1261325244.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/2vll71261325244.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.371271841 0.172822965 0.003510535 -0.144070891 [6] -0.259583917 -0.540782027 -0.324668163 -0.206272123 -0.069712091 [11] 0.071029122 0.249326721 0.745101959 0.275900076 0.120188571 [16] -0.003348201 -0.109703546 -0.207941050 -0.445077613 -0.274790551 [21] -0.179760962 -0.079011163 0.023550953 0.171470682 0.536120894 [26] 0.240660395 0.105896741 0.032587238 -0.068790292 -0.113149915 [31] -0.309803990 -0.206963526 -0.151891785 -0.094862542 -0.016327826 [36] 0.065581405 0.304668584 > (mypacf <- c(rpacf$acf)) [1] 0.371271841 0.040572860 -0.084943385 -0.147493808 -0.178943641 [6] -0.451554666 -0.023615722 -0.063111400 -0.044110980 -0.009618435 [11] 0.121611511 0.624559969 -0.352500811 -0.155010379 -0.018557285 [16] 0.004152882 -0.035785038 0.132725806 0.029029670 -0.064767956 [21] -0.066603619 -0.028523803 -0.040780698 -0.076282670 0.161773950 [26] 0.003162643 0.012732790 -0.078694687 0.113382702 -0.017631565 [31] -0.033813194 -0.024370648 0.004040219 -0.036242449 -0.102283326 [36] -0.100649612 > 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/3muek1261325244.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/49ki41261325244.tab") > > try(system("convert tmp/1a3tp1261325244.ps tmp/1a3tp1261325244.png",intern=TRUE)) character(0) > try(system("convert tmp/2vll71261325244.ps tmp/2vll71261325244.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.550 0.304 0.693