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(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 = '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/1qodx1281900908.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/2qodx1281900908.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.918196280 0.848018184 0.784935240 0.716782481 [6] 0.687226821 0.666740718 0.635293101 0.612023882 0.591653283 [11] 0.569570849 0.557963614 0.558172227 0.497166715 0.451610686 [16] 0.405507167 0.352764132 0.338790961 0.332520535 0.317007225 [21] 0.309992800 0.302539592 0.292026124 0.295662085 0.305971873 [26] 0.266035707 0.236206162 0.200058286 0.159434826 0.154024180 [31] 0.147159383 0.135629895 0.133268057 0.124960654 0.116595336 [36] 0.119256384 0.127215181 0.100435933 0.083379598 0.058671498 [41] 0.022993829 0.023662920 0.014409888 0.005255506 0.012069604 [46] 0.008982947 0.008932155 0.017229548 0.022457836 0.001637607 [51] -0.011023685 -0.034452448 -0.064832089 -0.062142689 -0.071470815 [56] -0.081255274 -0.077160233 -0.082534286 -0.086151532 -0.079272862 [61] -0.077793758 > (mypacf <- c(rpacf$acf)) [1] 0.9181962800 0.0314422263 0.0121227146 -0.0614648779 0.2057045865 [6] 0.0691395366 -0.0558187318 0.0214459111 0.0604230197 0.0223844761 [11] 0.0396076401 0.0938718409 -0.3699958136 0.0460306613 -0.0212197006 [16] -0.0093899982 0.0695361262 0.0436317614 -0.0181859089 0.0026787794 [21] 0.0803948766 0.0127989781 0.0559627569 0.0240679263 -0.1935752410 [26] -0.0165679791 -0.0157812430 0.0170548540 0.0041522993 -0.0402500743 [31] -0.0088521440 0.0081002954 0.0455958756 0.0178505706 0.0033326137 [36] 0.0170973606 -0.0710296084 0.0109365039 -0.0001371904 -0.0479949018 [41] 0.0337758688 -0.0798294844 0.0067909139 0.0428832586 0.0359016750 [46] 0.0048447683 -0.0134456459 -0.0107009394 -0.0537576681 0.0246178008 [51] -0.0282644173 -0.0249346860 0.0054983976 -0.0355644437 -0.0285765049 [56] 0.0033601719 0.0439098268 -0.0419504507 0.0103410952 -0.0091341444 > 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/34xbo1281900908.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/4xpsr1281900908.tab") > > try(system("convert tmp/1qodx1281900908.ps tmp/1qodx1281900908.png",intern=TRUE)) character(0) > try(system("convert tmp/2qodx1281900908.ps tmp/2qodx1281900908.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.622 0.312 2.906