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(40.04,40.04,40.03,40.03,41.63,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.38,42.06,42.06,42.05,42.05,42.05,42.05,44.36,44.48,44.49,44.49,44.49,44.49,44.49,44.48,44.48,44.48,44.48,44.48,44.48,44.49,44.49,44.49,44.49,44.49,44.49,44.49,44.49,45.5,45.94,45.95,45.96,45.96,45.96,45.96,45.96,45.96,45.96,45.96,45.97,46.06,47.9,47.93,47.94,47.94,47.94,47.94,47.94,47.94,47.94,47.94) > 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/freestat/rcomp/tmp/1z9n61243888112.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/2d4681243888112.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.0487215708 -0.0698999389 -0.0759603904 -0.0644143676 [6] -0.0599383643 -0.1224451299 0.0002282708 -0.0587516250 -0.0628381162 [11] -0.0456038695 -0.0420669438 0.0262983069 0.1080838870 -0.0490211799 [16] -0.0513312944 -0.0412012666 -0.0179575326 -0.0974697066 -0.0559649082 [21] -0.0471144291 0.1453814604 0.0301830512 0.0327026624 0.2659725308 [26] -0.0328636760 -0.0503747130 -0.0788872930 -0.0123834491 -0.0174167479 [31] -0.0311847094 -0.0326871563 -0.0285027847 0.0018008964 0.3188432049 [36] -0.0301704054 -0.0348172044 -0.0369287984 -0.0410101364 -0.0423805877 [41] -0.0876241612 0.0105442112 -0.0425399220 -0.0427751178 0.0108728037 [46] 0.1252638637 0.0340932141 -0.0249875230 -0.0259681951 > (mypacf <- c(rpacf$acf)) [1] 0.048721571 -0.072445701 -0.069305761 -0.063041093 -0.065365422 [6] -0.134296411 -0.009832697 -0.095982761 -0.091951200 -0.082695338 [11] -0.090953327 -0.032021912 0.060745682 -0.115084101 -0.082687312 [16] -0.083334304 -0.074791206 -0.162756840 -0.120881622 -0.181566660 [21] 0.045610557 -0.099938259 -0.062360579 0.204899840 -0.119709382 [26] -0.089857468 -0.063935688 -0.081578877 -0.070422302 -0.039063889 [31] -0.120873059 -0.055431921 -0.057511113 0.286035759 -0.061253323 [36] -0.024250985 -0.085981609 0.004812118 -0.011670945 -0.021570974 [41] -0.014100152 -0.004032484 -0.035080079 0.088132969 0.075271155 [46] 0.007027923 -0.117343475 -0.064736357 > 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/3ap811243888112.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/43rq31243888112.tab") > > system("convert tmp/1z9n61243888112.ps tmp/1z9n61243888112.png") > system("convert tmp/2d4681243888112.ps tmp/2d4681243888112.png") > > > proc.time() user system elapsed 0.800 0.424 0.912