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(62.7,62.3,61.9,62,62.3,62.8,62.4,62.3,62.7,62.7,62.9,63,62.2,62.3,62.8,62.8,62.8,62.2,62.6,62.8,62.5,62.4,62.3,61.9,61.7,62,62.1,61.7,61.8,61.8,61.8,61.3,61.3,61.3,61.2,61.4,62.2,62.9,63.1,63.5,63.6,64.4,64.1,65.1,65.8,65.9,65.4,65.5,64.8,63.2,62.7,62.1,61.9,60.6,60.7,59.8,59,58.3,59.3,59,59.1) > 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/html/rcomp/tmp/1h2q61260458885.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/2cfm71260458885.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.2181041181 0.2108780109 0.1746438746 0.3197099197 [6] -0.0367780368 0.0619269619 0.1031339031 -0.0379953380 -0.2219891220 [11] -0.1669256669 0.0344729345 -0.4187516188 -0.2800310800 -0.1466200466 [16] 0.0195545196 -0.2167573168 -0.0561512562 -0.0300958301 -0.0338254338 [21] -0.1214711215 0.0019684020 0.1436674437 -0.0157213157 -0.0684019684 [26] 0.0973840974 0.0752654753 -0.0486402486 0.0387982388 0.0858326858 [31] 0.0480445480 -0.0590261590 0.0702408702 0.1149443149 -0.0005439005 [36] -0.1061901062 0.0816109816 -0.0235172235 -0.0417508418 0.0015281015 [41] 0.0330225330 -0.0986531987 -0.0836052836 -0.0381248381 0.0001036001 [46] -0.0646205646 -0.0939911940 0.0381248381 -0.0284123284 0.0001036001 [51] 0.0266770267 -0.0095571096 -0.0433307433 0.0356902357 0.0406371406 [56] 0.0415695416 -0.0080031080 -0.0163947164 0.0017612018 -0.0035224035 > (mypacf <- c(rpacf$acf)) [1] 0.218104118 0.171465097 0.107244081 0.258153906 -0.198861822 [6] -0.004273479 0.074472204 -0.158110249 -0.181621726 -0.143871676 [11] 0.149461809 -0.391856193 -0.082325342 0.079762782 0.129795989 [16] 0.083592423 -0.064217096 -0.029849643 -0.015448171 -0.039074788 [21] -0.149571721 0.019706819 0.075132406 -0.230709868 0.035716630 [26] -0.053276937 0.089615053 0.104331945 -0.051969106 0.037421258 [31] -0.086416925 0.072469885 -0.054018083 -0.004403712 -0.059889709 [36] -0.079763949 -0.040852400 -0.034834675 0.144228778 -0.046044526 [41] -0.044189174 0.023567288 -0.105527041 0.058923926 -0.046397596 [46] 0.012270785 -0.029137517 -0.046047224 0.046161462 -0.021954030 [51] -0.029565426 -0.023330003 0.037901301 -0.011575189 -0.080707344 [56] -0.016235787 -0.022199970 -0.013630609 -0.013110584 > 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/3bp771260458885.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/44ep11260458885.tab") > > system("convert tmp/1h2q61260458885.ps tmp/1h2q61260458885.png") > system("convert tmp/2cfm71260458885.ps tmp/2cfm71260458885.png") > > > proc.time() user system elapsed 0.596 0.320 0.762