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(260288,261544,259886,257006,259670,258873,264416,263596,262586,260237,261690,259295,264170,264451,265538,261723,266189,265073,267007,266376,267406,262742,260300,263074,265940,264771,268403,264264,264118,266817,269296,269001,266707,267507,267510,267420,270845,270671,273653,271567,268372,268160,267879,271142,271323,269478,271008,269145,271684,273582,279475,276188,278422,281084,278618,280738,288897,282129,286406,284288,286139,288275,287670,286864,288798,288316,286915,288006,293338,303730,306248,305700,314849) > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '48' > #'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/1lcpf1244102608.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/2bh2a1244102608.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.1875766679 0.0538334578 -0.0173267604 0.0156619656 [6] -0.0627360140 0.2225344591 -0.0819542691 0.1264380620 -0.2320300147 [11] 0.0538124663 -0.1304545252 0.2007487244 0.0482171720 0.1215620374 [16] -0.2268894391 -0.0127447867 0.0611563582 0.0371295574 0.1153709996 [21] 0.2265681869 -0.2306154155 0.0624631429 -0.0263621220 0.0564833678 [26] -0.0003945963 0.1120027169 -0.0624942777 -0.1691212921 -0.0935540294 [31] 0.1003057713 -0.0733169605 0.1277103191 -0.0905292226 -0.0021650494 [36] -0.1185479867 0.0873417114 -0.0413720276 0.0646189830 -0.0422757355 [41] 0.0650040110 -0.1950671002 0.0524637876 0.0034197632 0.1203208017 [46] -0.1231125995 0.1210242618 -0.2024734807 -0.0292243032 > (mypacf <- c(rpacf$acf)) [1] -0.187576668 0.019328526 -0.003938451 0.011131570 -0.059470131 [6] 0.207695965 -0.002976833 0.104821078 -0.207451074 -0.025504332 [11] -0.117593726 0.146130053 0.140212154 0.123910793 -0.142134455 [16] -0.141471435 0.142955048 -0.015249856 0.169044920 0.177199200 [21] -0.078306337 -0.000857579 0.025117943 0.031675705 -0.110941141 [26] 0.015358316 0.025005771 -0.133139464 -0.052914011 0.005938515 [31] -0.083279668 0.001317856 -0.045952666 0.047915986 0.002182133 [36] 0.011683025 -0.115019533 -0.023872210 -0.088458744 0.070718473 [41] -0.006396890 -0.040923824 -0.008556843 0.046710203 -0.005538113 [46] 0.027276583 -0.055434272 -0.062335538 > 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/3w9g31244102608.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/4pjvc1244102608.tab") > > system("convert tmp/1lcpf1244102608.ps tmp/1lcpf1244102608.png") > system("convert tmp/2bh2a1244102608.ps tmp/2bh2a1244102608.png") > > > proc.time() user system elapsed 0.542 0.309 0.694