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(5.6,5.6,5.6,5.6,5.6,5.67,5.67,5.67,5.67,5.67,5.67,5.67,5.67,5.67,5.82,5.82,5.95,5.95,5.95,5.95,5.95,5.95,6.02,6.02,6.05,6.05,6.05,6.12,6.12,6.12,6.12,6.12,6.12,6.12,6.12,6.17,6.17,6.17,6.17,6.17,6.28,6.27,6.28,6.28,6.27,6.27,6.28,6.59,6.59,6.59,6.59,6.59,6.63,6.63,6.63,6.63,6.63,6.63,6.63,6.63,6.63,6.63,6.63,6.63,6.63,6.63,6.63,6.63,6.63,6.79,6.79,6.79) > 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/12yhp1228555308.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/2l0jx1228555308.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.955676540 0.911166223 0.864443133 0.827107668 [6] 0.789870548 0.754219933 0.717880899 0.678139111 0.636676276 [11] 0.594229986 0.551301803 0.506426379 0.459593878 0.410627281 [16] 0.370566279 0.330436436 0.297640572 0.263635059 0.228842782 [21] 0.193204733 0.157718027 0.121493730 0.084072759 0.045579822 [26] 0.007379053 -0.014928944 -0.038406297 -0.057769665 -0.077694559 [31] -0.099350335 -0.121024823 -0.147243830 -0.167217214 -0.191763664 [36] -0.217096879 -0.240241769 -0.263829214 -0.284579527 -0.305919914 [41] -0.327191459 -0.341982717 -0.357431934 -0.375527602 -0.393623269 [46] -0.412308054 -0.427396534 -0.441895897 -0.439509473 > (mypacf <- c(rpacf$acf)) [1] 0.955676540 -0.024819650 -0.048828399 0.083634988 -0.019653268 [6] -0.008103550 -0.017615773 -0.061505640 -0.039896184 -0.034860050 [11] -0.039085598 -0.053664968 -0.055755571 -0.058601634 0.067822082 [16] -0.034047757 0.046735177 -0.019566820 -0.039809993 -0.015169205 [21] -0.025395663 -0.045467792 -0.048655252 -0.054196443 -0.038304981 [26] 0.148111742 -0.053560800 0.006896623 0.012544577 -0.058907715 [31] 0.005908320 -0.083349116 0.028230522 -0.087412017 -0.065375900 [36] 0.001861398 -0.060845228 -0.021414839 -0.047206066 -0.012874791 [41] 0.042825898 -0.004238449 -0.073015559 -0.020865906 -0.042216016 [46] -0.019302861 -0.016313818 0.135709149 > 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/3kxoo1228555308.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/4k18m1228555308.tab") > > system("convert tmp/12yhp1228555308.ps tmp/12yhp1228555308.png") > system("convert tmp/2l0jx1228555308.ps tmp/2l0jx1228555308.png") > > > proc.time() user system elapsed 2.615 0.927 2.743