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(213,212,211,209,229,228,213,203,204,204,205,207,205,208,201,201,220,218,203,185,179,182,182,185,183,192,177,172,188,182,162,150,141,135,139,148,142,156,143,134,146,142,117,106,104,99,105,106,96,104,96,85,91,98,73,70,62,60,70,82,72,73,68,53,61,73,46,50,52,45,58,73,58,49,44,35,46,61,29,33,37,31,44,57,42,34,27,22,30,47,12,13,18,11,26,41,21,24,30,34,48,64,35,44,55,53,73,94,73,78,87,87,91,104,73,84,103,111,131,155) > par7 = '0.95' > par6 = 'White Noise' > 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/156s61278860695.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/2yyr91278860695.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.063859288 -0.254639993 0.229253815 -0.194541610 [6] -0.167779059 0.560641969 -0.119329880 -0.229923148 0.231332917 [11] -0.184566068 -0.110117172 0.814813255 -0.067296225 -0.312543213 [16] 0.164870586 -0.142362386 -0.167044429 0.489124465 -0.084728477 [21] -0.227719509 0.189171828 -0.123300748 -0.108837094 0.632440625 [26] -0.084269264 -0.336462157 0.128920669 -0.104296718 -0.192372031 [31] 0.402498977 -0.068056032 -0.236924126 0.130389398 -0.081843053 [36] -0.108596706 0.483414009 -0.041370449 -0.323215571 0.102039474 [41] -0.043775275 -0.187587910 0.331709348 -0.025270147 -0.218995730 [46] 0.081802250 -0.039403275 -0.101881795 0.346108836 0.001520136 [51] -0.283776450 0.052601462 -0.022216647 -0.190641249 0.248271973 [56] 0.020867987 -0.201237415 0.020368012 -0.006219674 -0.075729597 [61] 0.242692382 > (mypacf <- c(rpacf$acf)) [1] -0.063859288 -0.259777376 0.206930703 -0.266741369 -0.069979299 [6] 0.477509739 -0.179078206 0.022745151 0.004040578 -0.109422049 [11] 0.121305465 0.698757324 -0.124117569 -0.039079569 -0.186213816 [16] 0.070896069 0.063340858 -0.144576220 0.010319172 0.062899844 [21] -0.045623550 0.036759123 0.034723276 -0.070914031 -0.050847690 [26] -0.068447372 0.086580808 -0.055706514 -0.183540996 -0.012992274 [31] 0.002796654 -0.011463683 -0.100159021 -0.009480296 0.058561185 [36] -0.030269141 0.160454116 0.003806198 0.002976540 0.003882174 [41] 0.011827755 0.091867663 -0.034818896 -0.015990065 0.008134895 [46] 0.001678157 0.007427855 -0.071614819 0.045435855 0.022162630 [51] -0.074478382 -0.047847682 -0.082025303 -0.036025138 0.023016956 [56] -0.074772106 -0.066084346 -0.034874120 0.037359970 0.030875522 > 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/3kgqf1278860695.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/45y631278860695.tab") > > try(system("convert tmp/156s61278860695.ps tmp/156s61278860695.png",intern=TRUE)) character(0) > try(system("convert tmp/2yyr91278860695.ps tmp/2yyr91278860695.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.596 0.316 0.769