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(252,251,250,248,268,267,252,242,243,243,244,246,236,241,240,239,253,249,232,229,221,222,224,224,215,225,225,221,238,234,228,227,216,219,225,227,205,215,214,209,222,216,206,199,189,198,203,211,199,211,210,203,214,202,193,193,176,192,200,195,180,197,194,194,212,202,195,198,170,187,190,189,176,188,195,194,211,203,194,194,163,183,181,184,171,178,179,186,205,204,195,186,156,167,164,165,153,160,154,169,186,188,187,169,131,146,145,137,119,118,113,123,142,141,138,124,83,100,96,98) > 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/rcomp/tmp/1f5zz1281901474.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/2f5zz1281901474.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.147631632 -0.062281900 -0.051982740 -0.258772515 [6] -0.023127961 0.179888873 -0.057383807 -0.158145147 -0.051845815 [11] -0.099069286 -0.141077775 0.800440271 -0.147311155 0.006518413 [16] -0.023162772 -0.254226968 0.029955669 0.160231731 -0.099597367 [21] -0.074618064 -0.066592838 -0.133022800 -0.122336282 0.644307655 [26] -0.158152320 0.079533036 -0.010507818 -0.271950908 0.077067533 [31] 0.120098426 -0.095568298 -0.015512456 -0.057804289 -0.154186333 [36] -0.114268649 0.526961030 -0.164929816 0.092510787 0.010679767 [41] -0.263904794 0.123096229 0.082361001 -0.106061559 0.037607040 [46] -0.063122019 -0.155813405 -0.072924112 0.397218957 -0.131228422 [51] 0.096245752 -0.008665337 -0.239306309 0.148846028 0.072814614 [56] -0.096247229 0.050943457 -0.080110697 -0.130544217 -0.031902374 [61] 0.271935084 > (mypacf <- c(rpacf$acf)) [1] -0.147631632 -0.085950294 -0.076888209 -0.295183050 -0.147821432 [6] 0.101220399 -0.074179253 -0.290710258 -0.210939300 -0.172855514 [11] -0.412508881 0.681627178 -0.057131914 0.038567148 0.031652640 [16] 0.148781660 0.087334860 0.030299755 -0.022809106 0.058408563 [21] 0.002630389 -0.054207247 -0.029598112 0.029502217 -0.069846098 [26] 0.031161004 -0.014869584 -0.092749873 -0.007483744 -0.057629319 [31] 0.046935281 -0.082485785 0.055203348 -0.051155588 -0.028713828 [36] 0.036077787 -0.008555328 -0.130463735 0.024008257 0.010280168 [41] 0.022835572 -0.060336950 -0.051740025 0.017857558 -0.009191557 [46] -0.044905266 0.036826197 -0.060914467 0.062227682 -0.022086197 [51] -0.063391710 0.007081635 -0.019663431 0.084450670 -0.003491588 [56] -0.077028043 -0.049850276 0.091248523 -0.002493660 -0.097951273 > 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/3tyi01281901475.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/4xgyn1281901475.tab") > > try(system("convert tmp/1f5zz1281901474.ps tmp/1f5zz1281901474.png",intern=TRUE)) character(0) > try(system("convert tmp/2f5zz1281901474.ps tmp/2f5zz1281901474.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.850 0.280 1.106