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(0.89,0.88,0.87,0.87,0.87,0.87,0.88,0.87,0.86,0.86,0.86,0.84,0.84,0.83,0.84,0.88,0.9,0.89,0.91,0.94,0.94,0.95,0.95,0.98,0.96,1,1.05,1.03,1.07,1.12,1.1,1.06,1.11,1.08,1.07,1.02,1,1.04,1.02,1.07,1.12,1.08,1.02,1.01,1.04,0.98,0.95,0.94,0.94,0.96,0.97,1.03,1.01,0.99,1,1,1.02,1.01,0.99,0.98,1.01,1.03,1.03,1,0.96,0.97,0.98,1.02,1.04,1.01,1.01,1,1.01,1.02,1.03,1.06,1.12,1.12,1.13,1.13,1.13,1.17,1.14,1.08,1.07,1.12,1.14,1.21,1.2,1.23,1.29,1.31,1.37,1.35,1.26,1.26) > 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/18tum1228767657.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/23qsi1228767657.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.937192221 0.864089103 0.782138576 0.694159795 [6] 0.622117854 0.550887777 0.493539309 0.444411771 0.401114316 [11] 0.378340419 0.354383883 0.311521128 0.261233326 0.207803544 [16] 0.141089864 0.089488376 0.043518800 -0.003080451 -0.038924093 [21] -0.071881459 -0.089438966 -0.098743581 -0.108984716 -0.112596689 [26] -0.118251108 -0.130269396 -0.131391437 -0.131116687 -0.124979890 [31] -0.104175190 -0.086256766 -0.071793560 -0.053964633 -0.040661691 [36] -0.025150094 -0.013509237 -0.008545489 -0.003808679 -0.005669069 [41] -0.003904835 0.011408591 0.014154094 0.010880932 0.015064779 [46] 0.025312041 0.048331788 0.071517745 0.092047561 > (mypacf <- c(rpacf$acf)) [1] 0.9371922212 -0.1170384662 -0.1064236783 -0.0868361732 0.0932817305 [6] -0.0512796579 0.0567526667 0.0007915685 0.0091901687 0.1154295474 [11] -0.0434907356 -0.2013414180 -0.0745625209 0.0115879443 -0.1365930538 [16] 0.0950285959 0.0050794757 -0.0840398264 0.0184537272 -0.0068146201 [21] 0.0103785294 0.0176825801 -0.0059449196 -0.0044955143 0.0269277299 [26] -0.0347316850 0.0486832472 0.0058079697 0.0550355315 0.0928400608 [31] -0.0227359439 -0.0735443639 0.0251404246 -0.0050942022 -0.0097234895 [36] 0.0118057754 -0.0199656237 -0.0242715618 -0.0127894101 0.0213641363 [41] 0.0449396291 -0.1026162019 -0.0616641569 0.0786843849 0.1210789930 [46] 0.0826481659 -0.0213967798 -0.0074594162 > 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/3n5fk1228767657.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/4uke51228767657.tab") > > system("convert tmp/18tum1228767657.ps tmp/18tum1228767657.png") > system("convert tmp/23qsi1228767657.ps tmp/23qsi1228767657.png") > > > proc.time() user system elapsed 0.583 0.306 0.677