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(93,92,91,89,87,86,87,89,90,90,91,93,93,87,89,92,98,92,92,87,92,98,101,102,102,90,87,92,105,90,88,83,98,109,118,118,115,107,101,111,128,115,111,105,120,132,135,142,139,127,113,130,143,139,137,134,139,157,152,153,147,132,117,123,139,134,134,128,118,144,140,151,144,135,122,124,146,146,147,148,132,161,159,173) > 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/101st1282030311.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/2tb9e1282030311.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.881354753 0.781633142 0.697432517 0.702220400 [6] 0.715852746 0.700033849 0.653333566 0.576145791 0.540921494 [11] 0.559812341 0.590007982 0.624650093 0.536668075 0.438094820 [16] 0.356865074 0.351225339 0.372597726 0.368857777 0.340090332 [21] 0.278850770 0.239804173 0.245552555 0.266108367 0.282116204 [26] 0.223692993 0.124415271 0.034354698 -0.007712772 0.003271386 [31] -0.006475464 -0.040359003 -0.102022760 -0.149124514 -0.152294829 [36] -0.143140769 -0.137562066 -0.174042283 -0.243562735 -0.303200961 [41] -0.339435752 -0.309865799 -0.303573539 -0.310452529 -0.355752970 [46] -0.375104804 -0.371601626 -0.357788997 -0.343047684 > (mypacf <- c(rpacf$acf)) [1] 0.8813547529 0.0217143437 0.0195300417 0.3594001910 0.1210242480 [6] -0.0608526603 -0.0078087452 -0.1423113780 0.0590259421 0.2049811518 [11] 0.0358976352 0.1923138893 -0.4043491541 -0.1974146315 -0.0014088548 [16] -0.0515490069 0.1123611154 0.0829499994 0.0490348035 0.0322417682 [21] -0.1263249251 -0.0308669232 -0.0051382381 -0.0470848984 0.0173686084 [26] -0.1835208168 -0.1174179222 -0.1335989473 -0.0395089225 0.0002010894 [31] -0.0208960975 0.0564746695 0.0177181899 -0.0235220361 -0.0539429902 [36] -0.0851171537 0.0389244037 0.0265415536 0.0181973540 -0.0273662434 [41] 0.0398213382 -0.1122974197 -0.0343395557 -0.0680992056 0.1063228704 [46] 0.0089210412 -0.0398488149 0.0484855845 > 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/3wt8k1282030311.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/4iu6q1282030311.tab") > > try(system("convert tmp/101st1282030311.ps tmp/101st1282030311.png",intern=TRUE)) character(0) > try(system("convert tmp/2tb9e1282030311.ps tmp/2tb9e1282030311.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.750 0.540 1.271