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(357,363,364,363,358,357,357,380,378,376,380,379,384,392,394,392,396,392,396,419,421,420,418,410,418,426,428,430,424,423,427,441,449,452,462,455,461,461,463,462,456,455,456,472,472,471,465,459,465,468,467,463,460,462,461,476,476,471,453,443,442,444,438,427,424,416,406,431,434,418,412,404,409,412,406,398,397,385,390,413,413,401,397,397) > par5 = '12' > par4 = '0' > par3 = '0' > 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: 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/1ber81229603204.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/215a11229603204.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.94678734 0.88945206 0.84527781 0.81155915 0.78258271 [7] 0.73611521 0.66744329 0.60694900 0.55270684 0.50841182 0.47945832 [13] 0.43716818 0.36169175 0.29026681 0.22952867 0.17940232 0.13984638 [19] 0.08289247 0.01641428 -0.04182609 -0.08830221 -0.12123121 -0.14889838 [25] -0.19044911 -0.24748714 -0.29920386 -0.33624443 -0.36066895 -0.38039990 [31] -0.40954517 -0.44322876 -0.47202580 -0.48276143 -0.48285893 -0.47171579 [37] -0.46909341 -0.48057137 -0.49143104 -0.48994205 -0.47512757 -0.45867818 [43] -0.44981580 -0.44737656 -0.43484223 -0.40915937 -0.37793018 -0.34787540 [49] -0.32115091 -0.30544772 -0.28663759 -0.25953355 -0.22607179 -0.19168745 [55] -0.16030350 -0.13955210 -0.10851977 -0.06644939 -0.02384288 0.01145880 [61] 0.03922675 > (mypacf <- c(rpacf$acf)) [1] 0.9467873385 -0.0671295568 0.0987327564 0.0674768892 0.0347482268 [6] -0.1700804017 -0.2182068852 0.0251326018 -0.0468461510 0.0346162249 [11] 0.1494376481 -0.0787128422 -0.3197515954 -0.0334638703 -0.0221108426 [16] -0.0574097081 0.0625150265 -0.0463753722 -0.0436893228 -0.0409484386 [21] 0.0319850038 -0.0046234252 -0.0475721833 -0.0408268575 -0.1220463117 [26] -0.0687214201 0.0218010381 -0.0031497799 0.0002376139 0.0263905686 [31] -0.0222279430 -0.0890310636 0.0485889043 -0.0278764167 0.0967097290 [36] 0.0155315066 -0.0684741552 -0.0940327187 -0.0473699960 0.0229492094 [41] -0.0388529126 0.0441628185 0.0133954495 0.0330179599 -0.0019795049 [46] -0.0263888921 -0.0715954280 0.0353969631 -0.0231451248 -0.0268236410 [51] 0.0150847832 -0.0016209279 0.0151869567 0.0794731365 -0.0270099552 [56] 0.0436460866 0.0105714896 -0.0217222039 -0.0881557696 0.0104143720 > 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/38s2g1229603204.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/4nwrk1229603204.tab") > > system("convert tmp/1ber81229603204.ps tmp/1ber81229603204.png") > system("convert tmp/215a11229603204.ps tmp/215a11229603204.png") > > > proc.time() user system elapsed 1.536 0.546 1.641