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(95.5,76.7,79.4,55.2,60,64.8,82.3,210.5,106,80.8,97.3,189.5,90,69.3,87.3,57.4,56.2,61.6,77.7,177.2,97.6,81.6,96.8,191.3,106,75.1,72,63.5,57.4,62.3,79.4,178.1,109.3,85.2,102.7,193.7,108.4,73.4,85.9,58.5,58.6,62.7,77.5,180.5,102.2,82.6,97.8,197.8,93.8,72.4,77.7,58.7,53.1,64.3,76.4,188.4,105.5,79.8,96.1,202.5) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '-0.4' > par1 = '36' > #'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/1lsku1259944342.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/2p2kt1259944342.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.000000e+00 -8.247996e-02 9.363593e-02 1.294920e-01 1.144695e-01 [6] -5.646053e-02 6.712343e-02 5.325893e-02 -2.937059e-02 1.135525e-01 [11] -3.722032e-05 -4.048326e-03 -4.676604e-01 2.125878e-01 -1.539167e-01 [16] -1.309944e-01 -1.450494e-01 -6.818850e-02 -5.402106e-02 -1.237690e-01 [21] -1.032405e-01 -1.370064e-01 8.036147e-03 -2.617177e-02 4.939437e-02 [26] -1.783055e-01 9.431211e-02 -3.223572e-02 6.614377e-03 6.466234e-02 [31] 2.846026e-03 1.106466e-01 1.249843e-01 2.459409e-02 -1.777077e-02 [36] 4.471865e-02 -1.051323e-02 > (mypacf <- c(rpacf$acf)) [1] -0.0824799612 0.0874277543 0.1458503984 0.1333999266 -0.0622224446 [6] 0.0132957971 0.0395169838 -0.0269149138 0.1070681392 -0.0009367531 [11] -0.0245317943 -0.5272108140 0.1285335806 -0.0233082871 -0.0217936498 [16] -0.1536543827 -0.1882079745 0.0746446947 -0.0712264403 -0.0700554528 [21] -0.0145883133 0.0141434615 0.0586181341 -0.1874557078 0.0456066027 [26] 0.0048626965 -0.0813164183 -0.0963588340 0.0428286802 0.1026719103 [31] -0.0470562714 -0.0063432773 -0.0663282261 0.0015973119 -0.0626510330 [36] -0.1646212584 > 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/3ingh1259944342.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/4v4ca1259944342.tab") > > system("convert tmp/1lsku1259944342.ps tmp/1lsku1259944342.png") > system("convert tmp/2p2kt1259944342.ps tmp/2p2kt1259944342.png") > > > proc.time() user system elapsed 0.551 0.310 0.648