R version 2.11.1 (2010-05-31) Copyright (C) 2010 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,30,29,27,25,24,25,27,28,28,29,31,31,27,25,16,20,21,25,24,28,27,23,36,37,30,27,22,22,25,33,35,35,29,25,34,31,29,21,19,18,25,23,22,20,15,17,25,26,26,23,24,24,42,40,45,47,40,39,49,55,54,48,44,48,62,57,60,56,57,54,62,65,68,69,67,72,82,72,77,79,78,76,79) > 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/rcomp/tmp/1x24r1281876572.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/rcomp/tmp/2x24r1281876572.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.055890721 -0.131440999 -0.231367054 -0.091485674 [6] 0.040898125 0.373298048 0.065783427 -0.165004793 -0.164761548 [11] -0.158633104 0.042374871 0.618981732 -0.079800683 -0.092813531 [16] -0.305485474 -0.060931638 -0.009800431 0.341061278 -0.041216092 [21] -0.109424268 -0.032103352 -0.215694815 0.153098898 0.390028465 [26] -0.015565117 -0.122458970 -0.206232402 -0.087306243 0.047617059 [31] 0.340191119 -0.125227635 -0.055605848 -0.041375180 -0.135715479 [36] 0.094597559 0.182784785 0.034205070 -0.177436100 -0.100668001 [41] -0.111216206 0.078119268 0.182482151 -0.089410320 -0.007712936 [46] -0.038962988 -0.068502762 0.029065079 0.066588924 > (mypacf <- c(rpacf$acf)) [1] -0.055890721 -0.134986438 -0.252627514 -0.161551033 -0.063483197 [6] 0.305106948 0.112710408 -0.069820505 -0.039476453 -0.148465416 [11] -0.079481465 0.533210371 -0.068846851 0.058868395 -0.161913460 [16] -0.048144780 -0.099528265 -0.049499337 -0.140943050 0.032862605 [21] 0.230784468 -0.088181465 0.160193160 0.034625286 0.077034811 [26] -0.027719540 -0.012034368 -0.097877637 0.081269769 0.039941831 [31] -0.088131790 -0.017961503 -0.026719819 0.075389896 -0.145225922 [36] -0.141969841 0.016889061 -0.002958256 0.031956195 0.048010111 [41] -0.048822836 -0.072083007 0.079013764 -0.064527106 0.033861767 [46] -0.024609432 -0.015955649 -0.091945671 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3tu2i1281876572.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/rcomp/tmp/4xujo1281876572.tab") > > try(system("convert tmp/1x24r1281876572.ps tmp/1x24r1281876572.png",intern=TRUE)) character(0) > try(system("convert tmp/2x24r1281876572.ps tmp/2x24r1281876572.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.870 0.350 1.198