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(10570,10297,10635,10872,10296,10383,10431,10574,10653,10805,10872,10625,10407,10463,10556,10646,10702,11353,11346,11451,11964,12574,13031,13812,14544,14931,14886,16005,17064,15168,16050,15839,15137,14954,15648,15305,15579,16348,15928,16171,15937,15713,15594,15683,16438,17032,17696,17745,19394,20148,20108,18584,18441,18391,19178,18079,18483,19644,19195,19650) > 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/1imv71259260448.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/2cab81259260448.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.084606412 -0.081543726 0.156409233 0.066357552 [6] -0.188760343 -0.088690735 -0.073621523 -0.128472237 0.083767512 [11] -0.036622758 0.062945271 -0.052466406 -0.007180133 -0.048932044 [16] -0.101086656 -0.142251292 -0.056262604 0.057563015 -0.125520455 [21] 0.136456333 0.025197215 0.167987159 0.017282481 -0.029859995 [26] 0.011319873 0.124654022 -0.023829791 -0.109877613 0.116471257 [31] -0.079953058 -0.010430151 0.008458533 -0.033881609 -0.020601433 [36] -0.026261522 -0.005745620 0.023945539 -0.046211968 0.041881579 [41] 0.041179888 -0.016556096 -0.009870964 0.002829295 -0.041558038 [46] -0.030867364 0.017628147 0.039313221 -0.015861636 -0.005305035 [51] 0.012637078 0.042363033 -0.004152329 -0.055753596 0.050104484 [56] -0.008835069 -0.023834812 0.014451873 -0.005938568 > (mypacf <- c(rpacf$acf)) [1] -0.084606412 -0.089341499 0.143499271 0.087807263 -0.158901897 [6] -0.138983722 -0.148379149 -0.128071641 0.117478143 -0.006410955 [11] 0.094185091 -0.120493832 -0.113890327 -0.120299393 -0.147337833 [16] -0.147338400 -0.084719970 0.038016116 -0.114684394 0.053559255 [21] -0.098884657 0.098605453 -0.031124846 -0.115377677 -0.050777111 [26] 0.105931605 0.066633058 -0.020226979 0.011581225 -0.136170103 [31] -0.103113037 -0.046021970 -0.053560748 0.074271926 -0.056944761 [36] -0.009978147 0.050049636 -0.102642628 0.105778296 -0.051482731 [41] 0.074001614 -0.013511175 -0.044094776 -0.076908027 -0.042432105 [46] -0.008789883 0.026064347 -0.030031875 -0.097742285 -0.039149090 [51] 0.002779232 0.004568957 0.005354193 0.034635352 -0.005121074 [56] 0.016720932 -0.019172853 -0.020919118 > 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/3txms1259260448.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/4qop11259260448.tab") > > system("convert tmp/1imv71259260448.ps tmp/1imv71259260448.png") > system("convert tmp/2cab81259260448.ps tmp/2cab81259260448.png") > > > proc.time() user system elapsed 0.595 0.341 1.126