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(1.8,1.7,1.4,1.2,1,1.7,2.4,2,2.1,2,1.8,2.7,2.3,1.9,2,2.3,2.8,2.4,2.3,2.7,2.7,2.9,3,2.2,2.3,2.8,2.8,2.8,2.2,2.6,2.8,2.5,2.4,2.3,1.9,1.7,2,2.1,1.7,1.8,1.8,1.8,1.3,1.3,1.3,1.2,1.4,2.2,2.9,3.1,3.5,3.6,4.4,4.1,5.1,5.8,5.9,5.4,5.5,4.8,3.2) > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '0.0' > 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/1k9lc1229896052.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/2d8wx1229896052.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.1079251230 -0.1925759612 0.0313868961 -0.0227721205 [6] 0.0594365011 0.0006109631 -0.0726498719 -0.0529900729 -0.1101944082 [11] 0.1067520425 0.1560929369 -0.3642801377 -0.2518643915 0.0465802201 [16] 0.0531461818 -0.0250991648 -0.1361038843 0.0185113559 0.0600093615 [21] -0.0286323437 0.0543559097 0.0373705237 -0.1485376668 -0.0539419586 [26] 0.1453306850 -0.0090768220 -0.0657256157 0.0258264677 -0.0190377432 [31] 0.0186238403 0.0342595827 0.0878200308 0.0010027910 -0.0479627626 [36] -0.0300216229 0.0585491722 -0.0274640524 0.0027111611 0.0107674556 [41] -0.0011803386 0.0940924093 0.1119849462 0.0723725591 -0.0631482564 [46] -0.0991719378 -0.0268539341 0.0543114586 -0.0216135843 > (mypacf <- c(rpacf$acf)) [1] 0.1079251230 -0.2066305918 0.0832485385 -0.0832951912 0.1047417167 [6] -0.0529953908 -0.0259441775 -0.0657231142 -0.1135338049 0.1296536868 [11] 0.0806465363 -0.3722234020 -0.1370630985 -0.0420507443 0.0318043553 [16] -0.1008482248 -0.1259420399 0.0568928690 -0.0005937947 -0.0733809239 [21] -0.0788788197 0.0459300740 -0.0444865194 -0.1722884721 -0.0400598486 [26] -0.1218451579 0.0087938632 -0.0217849784 -0.2230520703 -0.0101712416 [31] 0.0377473192 0.0603050791 -0.1530577890 0.0007720088 -0.0930584611 [36] -0.0582997409 -0.1389833068 -0.0483311067 -0.0691834501 -0.0035402985 [41] -0.0475197524 0.0726614937 0.0536671623 -0.0057209312 -0.0977585037 [46] -0.1113620312 -0.0039195363 -0.0461679093 > 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/37xsi1229896052.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/4m7al1229896052.tab") > > system("convert tmp/1k9lc1229896052.ps tmp/1k9lc1229896052.png") > system("convert tmp/2d8wx1229896052.ps tmp/2d8wx1229896052.png") > > > proc.time() user system elapsed 0.563 0.326 0.671