R version 2.8.0 (2008-10-20) 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(258778,252791,256389,258961,258647,256304,250498,247883,249552,262626,264416,273049,272441,267564,265952,263937,264765,263386,258985,257334,257477,271486,274488,281274,272674,269704,268227,276444,272247,268516,263406,263619,265905,281681,287413,289423,281242,273878,269022,272630,270287,260447,262248,252806,238663,258438,266719,263279,258064,248828,248284,253376,251846,239494,239709,228793,229521,249999,254016,251178) > par5 = '12' > par4 = '0' > par3 = '0' > 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/freestat/rcomp/tmp/1aag81229280814.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/freestat/rcomp/tmp/27xcs1229280814.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.00000000 0.83286607 0.62085392 0.46598413 0.36213156 0.33465541 [7] 0.32243121 0.20713666 0.10936278 0.09716183 0.14993342 0.24548732 [13] 0.29151581 0.14583102 -0.01403551 -0.14389757 -0.24232175 -0.26952286 [19] -0.27016193 -0.33303710 -0.39893226 -0.38653980 -0.29731464 -0.17898574 [25] -0.09798243 -0.13270762 -0.22176326 -0.28079942 -0.29848071 -0.27737422 [31] -0.26244194 -0.27619989 -0.30987656 -0.26672285 -0.17983425 -0.09152060 [37] -0.02040669 > (mypacf <- c(rpacf$acf)) [1] 0.832866069 -0.237688082 0.082873091 0.014592320 0.170555709 [6] -0.018654028 -0.315741324 0.136699707 0.174775704 0.143502570 [11] 0.076301692 -0.101498402 -0.453546778 0.039874803 -0.189348183 [16] -0.119833501 -0.004748128 0.073304968 0.042804280 -0.181473416 [21] 0.071241344 0.117676634 -0.040678782 -0.039895138 -0.009408293 [26] -0.120958999 0.102889843 -0.057390153 -0.074407637 -0.081685921 [31] 0.120729517 -0.077662724 -0.010113788 -0.154314048 0.014741419 [36] 0.023364359 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/38j541229280814.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/freestat/rcomp/tmp/4w16i1229280814.tab") > > system("convert tmp/1aag81229280814.ps tmp/1aag81229280814.png") > system("convert tmp/27xcs1229280814.ps tmp/27xcs1229280814.png") > > > proc.time() user system elapsed 0.772 0.422 0.886