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(100.95,101.26,101.42,101.68,101.75,101.89,102.07,102.22,102.45,102.62,102.67,102.86,104.78,104.87,105.06,105.14,105.32,105.54,105.68,105.77,106.07,106.03,106.13,106.28,106.61,106.74,107.01,107.1,107.28,107.4,107.59,107.69,107.78,108.02,108,108.07,108.36,108.74,108.99,109.21,109.31,109.41,109.54,109.81,109.85,110.01,110.23) > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1.0' > 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/1ylzz1230060517.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/238kd1230060517.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.0000000000 -0.0534632802 -0.0677569777 -0.0765022188 0.0179646285 [6] -0.0209551653 -0.0058199322 -0.0835133576 -0.0036851279 -0.0755845559 [11] -0.0512948839 0.0464372737 0.0871409151 0.0073147534 0.0403860534 [16] -0.0536403515 -0.0101200586 -0.0171825078 -0.0127315243 -0.0206938622 [21] -0.0613851511 0.0333799450 -0.1087519371 -0.0432486495 0.0430407808 [26] 0.1113722900 0.0261583663 0.0135860273 -0.0503481004 -0.0417871968 [31] -0.0250771585 0.0391997094 -0.0833595941 -0.0348243501 0.0132005284 [36] 0.0082515320 0.0088831308 0.0063548349 0.0034665836 -0.0029543736 [41] 0.0057492266 -0.0046325263 0.0027508088 -0.0043476360 -0.0015614466 [46] 0.0005845364 > (mypacf <- c(rpacf$acf)) [1] -0.0534632802 -0.0708177199 -0.0848341377 0.0035150553 -0.0316127114 [6] -0.0142035495 -0.0882923715 -0.0208353360 -0.0936630267 -0.0817695263 [11] 0.0221861523 0.0638659638 0.0103193370 0.0491873153 -0.0438529227 [16] -0.0250441362 -0.0299435637 -0.0274473401 -0.0227156756 -0.0685600295 [21] 0.0427355384 -0.1235601862 -0.0737933170 0.0053720806 0.0667509509 [26] 0.0236285501 0.0238986914 -0.0363846205 -0.0728092702 -0.0506776784 [31] 0.0210406279 -0.0985168842 -0.0456359788 0.0417420277 -0.0135573832 [36] -0.0030814543 -0.0350143875 -0.0363037010 -0.0555194543 -0.0020668653 [41] -0.0040009351 -0.0306375856 -0.0009086304 0.0053562130 -0.0203311735 > 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/34ap71230060517.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/4152u1230060517.tab") > > system("convert tmp/1ylzz1230060517.ps tmp/1ylzz1230060517.png") > system("convert tmp/238kd1230060517.ps tmp/238kd1230060517.png") > > > proc.time() user system elapsed 0.610 0.337 1.033