R version 2.7.0 (2008-04-22) Copyright (C) 2008 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(44028,45564,44277,44976,45406,47379,49200,50221,51573,53091,53337,54978,57885,67099,67169,69796,70600,71982,73957,75273,76322,77078,77954,79238,82179,83834,83744,84861,86478,88290,90287,91230,92380,92506,94172,94728,96581,97344,98346,98214,98366,98768,99832,99976,99961,100164,99964,99304,104008,104644,103950,104263,104241,105141,106018,105866,105944,106379,105082,104915,107026) > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > 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: Write here your technical program description (don't use hard returns!) > 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 (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/1oni91228478552.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x,par1,main='Autocorrelation',xlab='lags',ylab='ACF') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2ftks1228478552.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.062242299 0.137452427 -0.020702140 0.023726277 [6] 0.012677946 0.031860815 -0.072456459 0.002463666 -0.054765571 [11] -0.025478959 -0.036009697 -0.429569039 -0.063836845 0.049347395 [16] 0.101789157 0.096350175 0.036462485 0.005615148 0.114929461 [21] -0.006206886 0.089265863 -0.025591792 -0.143476517 -0.044615917 [26] 0.113862592 -0.116601360 -0.085380742 -0.128251349 -0.032292824 [31] -0.037721275 -0.088671030 -0.048020033 0.014716317 -0.054675729 [36] 0.245521830 -0.012815521 > (mypacf <- c(rpacf$acf)) [1] 0.0622422985 0.1340978322 -0.0372687594 0.0087597747 0.0191591367 [6] 0.0254169296 -0.0809894862 0.0045949946 -0.0340032103 -0.0275825103 [11] -0.0205854218 -0.4341810226 -0.0072863678 0.2011683609 0.0970495393 [16] 0.0691876171 0.0165410177 0.0037033447 0.0680678025 -0.0362801522 [21] 0.0272869080 -0.0279699790 -0.2173247083 -0.2951055640 0.1885017348 [26] 0.0718061601 -0.0497993516 -0.0138383826 0.0050043460 -0.0298476841 [31] -0.0583628463 -0.0554812439 0.1241952342 -0.1060787896 -0.0002889469 [36] -0.1886647602 > 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/3q8j71228478552.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/4qr271228478552.tab") > > system("convert tmp/1oni91228478552.ps tmp/1oni91228478552.png") > system("convert tmp/2ftks1228478552.ps tmp/2ftks1228478552.png") > > > proc.time() user system elapsed 1.482 0.564 1.572