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(233084,233898,231355,232662,230037,231814,246796,247891,248291,245766,238776,242541,246861,246843,246947,241679,240085,241514,250525,250567,252145,251877,245817,248269,246310,246733,245028,240022,238614,238096,248530,248381,247567,241783,235000,237384,238020,236412,232279,230408,230254,229217,239658,239906,236558,223566,216054,214685,216086,211692,204681,203075,198401,191246,206750,209611,199573,195635,190062,193134,194795,190835,185045,184425,177293,180549,195344,196597,189102,185749,185145,192243,197356) > par5 = '12' > par4 = '0' > par3 = '0' > 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/1ket51244102849.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/2c7bu1244102849.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.96223457 0.91100153 0.86841098 0.83899965 0.82402077 [7] 0.80156481 0.75609524 0.69201034 0.63518704 0.59847614 0.57438393 [13] 0.54094973 0.47431327 0.40363329 0.34122404 0.29518162 0.26062936 [19] 0.22291944 0.16958284 0.09907890 0.04615694 0.01136528 -0.01656143 [25] -0.04877917 -0.10049282 -0.15567716 -0.19787411 -0.22042274 -0.22699479 [31] -0.23800880 -0.26048794 -0.29425889 -0.31515721 -0.32481616 -0.33077305 [37] -0.33895940 -0.36263418 -0.38924572 -0.40574058 -0.40490793 -0.39608423 [43] -0.39053649 -0.39343166 -0.40581326 -0.40572108 -0.39606192 -0.38067208 [49] -0.36422632 > (mypacf <- c(rpacf$acf)) [1] 0.9622345654 -0.2009837709 0.1269215409 0.1125643674 0.1468099207 [6] -0.1489322799 -0.2472074694 -0.1959541624 0.0939666476 0.1154709789 [11] 0.0100959935 -0.1829170493 -0.3651592800 0.1685174193 0.0620577559 [16] -0.0056966829 -0.1828680678 0.0048925977 0.0682194466 -0.0926632560 [21] 0.1199771100 -0.1065086227 -0.0538769611 -0.0081457670 -0.0397730537 [26] -0.0037966153 0.0717534902 0.0163701337 0.0735612410 -0.0608276894 [31] 0.0780631472 -0.0406227246 -0.0419518804 -0.1195199311 -0.0991186268 [36] 0.0415522530 -0.0726397267 0.0005265462 -0.0304224383 0.0233638539 [41] -0.0011298045 0.0741281139 -0.0480015475 -0.0486231066 0.0448792372 [46] -0.0218408572 0.0410204262 0.0111436268 > 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/3hqtq1244102849.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/4gysf1244102849.tab") > > system("convert tmp/1ket51244102849.ps tmp/1ket51244102849.png") > system("convert tmp/2c7bu1244102849.ps tmp/2c7bu1244102849.png") > > > proc.time() user system elapsed 0.555 0.302 0.752