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(101.6,101.8,102.1,102.1,101.9,102.1,102,102.1,102.2,102.3,102.7,102.8,103.1,103.1,103.3,103.5,103.3,103.5,103.8,103.9,103.9,104.2,104.6,104.9,105.2,105.2,105.6,105.6,106.2,106.3,106.4,106.9,107.2,107.3,107.3,107.4,107.55,107.87,108.37,108.38,107.92,108.03,108.14,108.3,108.64,108.66,109.04,109.03,109.03,109.54,109.75,109.83,109.65,109.82,109.95,110.12,110.15,110.2,109.99,110.14,110.14,110.81,110.97,110.99,109.73,109.81,110.02,110.18,110.21,110.25,110.36,110.51,110.64,110.95,111.18,111.19,111.69,111.7,111.83,111.77,111.73,112.01,111.86,112.04) > 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/1tt6g1228767804.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/27o221228767804.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.0010571472 -0.0544570252 -0.2104766974 0.0119819883 [6] 0.1248363620 0.0733284815 0.0772553415 -0.0074536155 -0.1581634964 [11] 0.0124171295 0.0605707764 0.0552573698 0.0829574077 -0.0915484315 [16] -0.0337951757 0.0799145651 0.0137294974 0.0274178785 -0.0544506329 [21] -0.0562210758 -0.0632902873 -0.0498277505 0.0986260097 0.1776549283 [26] 0.0017207829 -0.1277102508 -0.0191091970 -0.0197146555 0.0104441951 [31] 0.0104459688 -0.0125170988 -0.0445641545 -0.1394850965 -0.0338268776 [36] 0.0493277417 -0.1398621432 0.0473388619 -0.0765031369 0.0994712983 [41] -0.0535827586 -0.0844369055 -0.0778190197 -0.0365188420 0.0597651225 [46] -0.0000987534 -0.0826487169 -0.0208283036 0.1131616213 > (mypacf <- c(rpacf$acf)) [1] -0.001057147 -0.054458204 -0.211221626 0.006429639 0.107129679 [6] 0.034531742 0.098358183 0.050484884 -0.141220058 0.030802366 [11] 0.046470770 -0.028038115 0.100188748 -0.047697153 -0.028934500 [16] 0.136716732 -0.030328115 -0.029443801 0.008034427 -0.076838862 [21] -0.087711977 -0.035699851 0.029274619 0.169675118 0.057546389 [26] -0.098880242 0.088694822 -0.050549376 -0.131862174 0.026596586 [31] -0.060408980 -0.068201154 -0.037262551 -0.063934010 0.009546217 [36] -0.178686051 0.010949138 -0.021752297 0.077316185 -0.091926970 [41] -0.071642803 -0.050763945 -0.061121004 0.082558759 -0.023547070 [46] -0.057164792 0.004053550 0.122815545 > 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/38xy11228767804.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/4npv81228767804.tab") > > system("convert tmp/1tt6g1228767804.ps tmp/1tt6g1228767804.png") > system("convert tmp/27o221228767804.ps tmp/27o221228767804.png") > > > proc.time() user system elapsed 0.823 0.439 1.484