R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(7.14,7.24,7.33,7.61,7.66,7.69,7.7,7.68,7.71,7.71,7.72,7.68,7.72,7.74,7.76,7.9,7.97,7.96,7.95,7.97,7.93,7.99,7.96,7.92,7.97,7.98,8,8.04,8.17,8.29,8.26,8.3,8.32,8.28,8.27,8.32,8.31,8.34,8.32,8.36,8.33,8.35,8.34,8.37,8.31,8.33,8.34,8.25,8.27,8.31,8.25,8.3,8.3,8.35,8.78,8.9) > par8 = '' > 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/rcomp/tmp/15jsv1293185828.ps",horizontal=F,onefile=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/2farg1293185828.ps",horizontal=F,onefile=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.851670107 0.712804558 0.632530816 0.588766221 [6] 0.554641897 0.530390520 0.497038271 0.470090169 0.451235484 [11] 0.418567483 0.388608367 0.350434498 0.301546694 0.249302240 [16] 0.192675305 0.156654707 0.124902279 0.095813066 0.063300723 [21] 0.036708527 0.001877526 -0.016415601 -0.042814305 -0.085254453 [26] -0.123087821 -0.169992333 -0.234950766 -0.288959076 -0.312776178 [31] -0.315581582 -0.323532626 -0.321519652 -0.307300209 -0.308426072 [36] -0.314945385 -0.306010484 -0.306240232 -0.298800299 -0.301421129 [41] -0.309958864 -0.318799807 -0.306963070 -0.296418891 -0.277024623 [46] -0.257509829 -0.240600687 -0.223207276 -0.216319984 > (mypacf <- c(rpacf$acf)) [1] 0.851670107 -0.045647358 0.133613786 0.093498386 0.050109271 [6] 0.067548966 -0.005890206 0.042934486 0.033683467 -0.040059153 [11] 0.015397369 -0.051076570 -0.062613493 -0.058872492 -0.086546455 [16] 0.011004064 -0.046054048 -0.018376666 -0.031709165 -0.009280235 [21] -0.048940311 0.034118201 -0.049417498 -0.064431478 -0.023463288 [26] -0.094115343 -0.131171614 -0.066939286 -0.004882414 0.018562211 [31] -0.038018506 0.049418113 0.065230557 -0.034020159 0.020037923 [36] 0.061537070 -0.011983066 0.048539160 -0.044937974 -0.025903813 [41] -0.048381566 -0.003302033 -0.033902932 0.014462082 -0.007537460 [46] 0.007173503 0.009580858 -0.035162075 > 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/3jbqm1293185828.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/4u2pp1293185828.tab") > > try(system("convert tmp/15jsv1293185828.ps tmp/15jsv1293185828.png",intern=TRUE)) character(0) > try(system("convert tmp/2farg1293185828.ps tmp/2farg1293185828.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.640 0.630 1.333