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.73,101.63,101.43,101.34,101.01,100.89,100.93,100.77,100.3,99.86,99.71,99.93,99.88,99.92,99.87,99.63,100.05,99.88,100.11,100.05,100.07,100.2,100.21,99.76,99.41,99.24,99.65,99.7,99.79,99.84,101,101.62,101.98,101.46,102.28,102.14,102.02,102.21,101.61,102.38,102.19,102.04,101.76,101.9,102.01,102.37,103.04,103.42,103.76,104.41,104.75,104.28,103.89,104.09,103.8,105.03,105.86,106.04,106.03,106.13,107.21,107.66,108.08,108.76,108.26,108.71,108.65,108.61,108.86,109.54,108.22,108.77,109.9,110.13,109.6,110.42,110.6,109.73,110.72,111.08,111.14,111.01,110.56,111.57) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '36' > #'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/1ug7y1229599909.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/214m31229599909.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.96763296 0.94093438 0.91157288 0.87866317 0.84358917 [7] 0.80966047 0.78040687 0.74338086 0.70716993 0.67439064 0.63638230 [13] 0.59873941 0.56522082 0.53347585 0.49274419 0.45417124 0.41331677 [19] 0.37136731 0.32714405 0.28386179 0.23744839 0.19601125 0.15845893 [25] 0.11973566 0.08704829 0.05400900 0.01960404 -0.01305740 -0.04260184 [31] -0.06694559 -0.09259264 -0.11544313 -0.14067399 -0.17046535 -0.19755211 [37] -0.22165868 > (mypacf <- c(rpacf$acf)) [1] 0.967632960 0.072556044 -0.048193232 -0.077927039 -0.060774368 [6] -0.003167535 0.065406885 -0.123682751 -0.035677846 0.033099732 [11] -0.086420490 -0.023470540 0.045743400 0.005923259 -0.150523992 [16] -0.019920139 -0.077451725 -0.025521609 -0.046037912 -0.042738643 [21] -0.101972332 0.075708038 0.035983583 -0.057510560 0.078325155 [26] -0.029487328 -0.090682376 0.006511873 0.034010281 0.034207616 [31] 0.004082888 -0.028245711 -0.097868299 -0.082803626 0.029865679 [36] 0.003850572 > 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/3aevs1229599909.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/4tsrf1229599909.tab") > > system("convert tmp/1ug7y1229599909.ps tmp/1ug7y1229599909.png") > system("convert tmp/214m31229599909.ps tmp/214m31229599909.png") > > > proc.time() user system elapsed 0.556 0.318 0.679