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(93.89,93.36,92.25,91.07,90.93,90.68,90.65,90.6,90.02,89.74,89.31,89.16,89.15,88.98,88.25,87.36,87.13,86.93,86.93,86.93,86.98,86.16,85.88,85.91,85.91,85.6,84.9,83.67,83.41,83.33,83.32,83.3,82.73,82.2,81.7,81.52,81.52,81.55,81.89,81.8,81.84,81.77,81.77,82.98,83.13,82.84,82.8,82.8,82.8,82.98,81.91,81.64,81.4,81.21,81.21,81.23,81.01,80.55,80.5,80.54,80.54,80.72,80.63,80.36,79.88,79.66,79.66,79.13,78.81,78.67,78.43,78.13,78.13,78.07,76.94,74.97,75,75.1,75.1,75.02,73.87,73.18,72.55,72.42,72.4,72.45,71.42,70.89,70.42,69.57,69.57,69.44,68.25,66.86,66.5,66.46) > par5 = '12' > par4 = '1' > par3 = '0' > 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/1jfw61228944697.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/2czfp1228944697.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.000000000 0.947243142 0.880190742 0.812507800 0.749299483 [6] 0.681581948 0.606493499 0.533773345 0.469999389 0.407491120 [11] 0.330117367 0.253915188 0.185510403 0.150019162 0.124112925 [16] 0.098367529 0.069993811 0.050916022 0.031668979 0.003386092 [21] -0.034868338 -0.084608340 -0.117385812 -0.141746572 -0.176254394 [26] -0.220493634 -0.280202354 -0.333172194 -0.375359471 -0.409748815 [31] -0.438782055 -0.465521899 -0.477426329 -0.475075743 -0.475249806 [36] -0.484584184 -0.481310446 -0.466457151 -0.434144733 -0.412291292 [41] -0.395997225 -0.381896176 -0.354904960 -0.323593383 -0.302329866 [46] -0.279724936 -0.251119404 -0.207902927 -0.167306141 > (mypacf <- c(rpacf$acf)) [1] 0.947243142 -0.166248964 -0.023820930 0.006559283 -0.092905040 [6] -0.101481728 -0.003405939 0.030756424 -0.057002599 -0.189114440 [11] 0.001393236 0.006166939 0.246299856 0.001817502 -0.027705146 [16] -0.060934219 0.027314933 -0.087338922 -0.093158827 -0.089317699 [21] -0.165312877 0.061575255 0.022591684 -0.134152043 -0.022331900 [26] -0.223631753 0.025566121 0.040245201 0.093618213 0.007701368 [31] -0.164947908 0.023878962 0.029532049 -0.015351767 -0.071253872 [36] 0.018064381 -0.026795205 0.068347930 -0.112012072 -0.040888967 [41] -0.052645144 0.071267953 0.065624113 0.031160394 0.043088548 [46] 0.011997908 -0.029324057 0.032020515 > 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/3b7ny1228944697.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/466yx1228944697.tab") > > system("convert tmp/1jfw61228944697.ps tmp/1jfw61228944697.png") > system("convert tmp/2czfp1228944697.ps tmp/2czfp1228944697.png") > > > proc.time() user system elapsed 0.880 0.492 5.286