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(111.4,87.4,96.8,114.1,110.3,103.9,101.6,94.6,95.9,104.7,102.8,98.1,113.9,80.9,95.7,113.2,105.9,108.8,102.3,99,100.7,115.5,100.7,109.9,114.6,85.4,100.5,114.8,116.5,112.9,102,106,105.3,118.8,106.1,109.3,117.2,92.5,104.2,112.5,122.4,113.3,100,110.7,112.8,109.8,117.3,109.1,115.9,96,99.8,116.8,115.7,99.4,94.3,91,93.2,103.1,94.1,91.8,102.7) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > 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/1wf6g1259090300.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/2c8tq1259090300.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.0000000000 0.1843824915 -0.1080609605 0.0627202408 0.0364466824 [6] 0.2670155696 0.2744978462 0.1091232582 -0.0862825625 -0.0602593762 [11] -0.2256123785 -0.0013715148 0.5006382913 -0.0574066201 -0.2780351306 [16] -0.1658253549 -0.1007672416 0.1092226563 0.0740581467 -0.0146184434 [21] -0.1783119290 -0.1112845426 -0.2307387142 -0.0567227818 0.2784032783 [26] -0.0730044781 -0.2955392583 -0.2282023386 -0.0589654241 0.0397439435 [31] -0.0045288412 -0.0423672045 -0.1783227713 -0.0876946519 -0.0911358264 [36] -0.0872858151 0.1619998239 -0.0260247376 -0.1891178409 -0.1220875211 [41] 0.0292822321 0.0527350614 0.0574582895 0.0193872342 -0.0369849603 [46] 0.0369968495 0.0360785243 0.0341413983 0.1582836374 0.0462283252 [51] -0.0515908157 0.0007518821 0.0484618156 0.0422689259 0.0410445109 [56] -0.0081312580 -0.0178209045 0.0508254417 0.0339693091 -0.0093237971 [61] -0.0027396707 > (mypacf <- c(rpacf$acf)) [1] 0.184382491 -0.147057358 0.119234113 -0.019877212 0.307785614 [6] 0.167383777 0.130884575 -0.131518262 -0.037445908 -0.427379841 [11] -0.021400744 0.437999133 -0.150391896 -0.065342617 -0.105059228 [16] 0.014281600 -0.090157949 -0.068430447 0.099718750 -0.052347928 [21] 0.018424625 -0.109849449 -0.027135066 -0.096302235 0.020458758 [26] -0.138792991 -0.025766770 0.040735629 -0.074228558 -0.053776899 [31] -0.009729536 -0.005263479 -0.044045205 0.108691523 -0.174722869 [36] -0.051534779 -0.117635832 0.055511923 -0.021159439 -0.002272064 [41] 0.014947802 0.041229888 -0.042941205 0.088337349 -0.041409505 [46] -0.006107246 0.058445350 -0.072448232 -0.079315906 -0.012786654 [51] -0.001152644 -0.109608156 -0.048170856 0.025901149 -0.061499568 [56] 0.017429497 0.042048310 0.074983643 -0.120592177 -0.071753187 > 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/3hrzb1259090300.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/49u001259090300.tab") > > system("convert tmp/1wf6g1259090300.ps tmp/1wf6g1259090300.png") > system("convert tmp/2c8tq1259090300.ps tmp/2c8tq1259090300.png") > > > proc.time() user system elapsed 0.596 0.316 0.720