R version 2.7.0 (2008-04-22) 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.82,1.76,1.79,1.74,1.78,1.80,1.80,1.80,1.79,1.82,1.82,1.83,1.77,1.77,1.77,1.77,1.74,1.78,1.78,1.78,1.78,1.81,1.84,1.80,1.78,1.76,1.74,1.72,1.73,1.77,1.81,1.83,1.87,1.89,1.82,1.79,1.79,1.82,1.82,1.81,1.81,1.78,1.80,1.79,1.83,1.82,1.80,1.82,1.84,1.82,1.81,1.79,1.87,1.89,1.92,1.9,1.91,1.95,2.04,1.99,1.94,1.93,1.89,1.87,1.89,1.9,1.93,1.94,1.88,1.89,1.92,1.91,1.89,1.89,1.98,2.02,2.02,1.99,1.97,1.96,1.95,1.98,2.00,2.00) > par5 = '12' > par4 = '0' > 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/rcomp/tmp/1mfj91228948912.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/287wf1228948912.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.89905893 0.78273134 0.69145825 0.64362894 0.59770883 [7] 0.55786877 0.52866145 0.50249755 0.46911938 0.43611853 0.43498202 [13] 0.42132165 0.39265885 0.36608600 0.36455862 0.36189024 0.33265807 [19] 0.30058583 0.28236147 0.28463214 0.29714694 0.30663640 0.27552667 [25] 0.22960656 0.17629142 0.10324493 0.04175076 -0.02526087 -0.09341123 [31] -0.15376667 -0.18735948 -0.20273248 -0.17693013 -0.16383467 -0.16346867 [37] -0.17411274 -0.17944722 -0.19939324 -0.23110172 -0.25882461 -0.25410248 [43] -0.24179329 -0.22018439 -0.22229470 -0.23559357 -0.26274709 -0.27756879 [49] -0.27682999 > (mypacf <- c(rpacf$acf)) [1] 0.899058932 -0.133419694 0.073286821 0.156252597 -0.042090393 [6] 0.048556478 0.065188532 -0.005151653 -0.022934041 0.017693252 [11] 0.155570466 -0.100352974 -0.032262566 0.063637592 0.073464093 [16] -0.028798842 -0.097375586 0.030900350 0.018391448 0.061483292 [21] 0.100599138 -0.017977653 -0.210436041 -0.018897235 -0.037519769 [26] -0.256429391 -0.032685346 -0.122392485 -0.148568811 -0.048448360 [31] 0.037540803 -0.008181185 0.170679215 -0.002830568 0.020307101 [36] -0.041568090 0.007860045 -0.102964241 -0.065322181 -0.021094738 [41] 0.146458144 -0.012879958 0.113399129 -0.111471532 -0.005486921 [46] -0.082819234 0.094167461 0.071557833 > 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/3al3w1228948912.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/4eqgl1228948912.tab") > > system("convert tmp/1mfj91228948912.ps tmp/1mfj91228948912.png") > system("convert tmp/287wf1228948912.ps tmp/287wf1228948912.png") > > > proc.time() user system elapsed 1.513 0.544 1.611