R version 2.10.1 (2009-12-14) Copyright (C) 2009 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(103.6,104.7,105.5,106.6,107.2,107.5,108.3,108.7,108.8,109.8,109.5,109.2,110.6,110.1,109.9,109.7,109.4,109.4,109.4,109.5,109.5,109.9,110,110.8,112.4,112.8,113.7,114.5,114.8,115.6,115.8,115.8,116.3,116.3,116.8,116.7,116.8,117,117.2,117.1,117.3,117.4,117.7,117.9,118.8,119.9,122.4,123.5,125.6,127.4,128.9,129.5,130.8,132.7,134,132.9,133.1,131.7,128.8,125.1,123.9,121.8,119.2,118.9,119.6,120.2,119.6,121,120.4,120.4,121.4,121.7) > par7 = '0.95' > par6 = 'White Noise' > 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: > 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 (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > 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/rcomp/tmp/1nz351275738425.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/2nz351275738425.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.96633614 0.92403969 0.87495698 0.81935538 0.75839044 [7] 0.69868395 0.64102482 0.58608324 0.53557839 0.49349413 0.45236890 [13] 0.41244703 0.38110196 0.34950459 0.31678518 0.28366248 0.25068476 [19] 0.21506016 0.17881338 0.14230465 0.10397216 0.06399323 0.02217980 [25] -0.01855368 -0.05489408 -0.09147525 -0.12444854 -0.15501306 -0.18432692 [31] -0.21109511 -0.23638628 -0.26026426 -0.28034682 -0.29850983 -0.31256991 [37] -0.32406748 -0.33361368 -0.34194262 -0.34842574 -0.35543523 -0.36273714 [43] -0.37210268 -0.38253606 -0.39408173 -0.40569776 -0.41565896 -0.41875920 [49] -0.41959159 > (mypacf <- c(rpacf$acf)) [1] 0.9663361403 -0.1475326120 -0.1103660161 -0.1055556358 -0.0880480324 [6] 0.0131805776 0.0080453101 0.0062453454 0.0209998720 0.0718810473 [11] -0.0564711651 -0.0404973050 0.0838580326 -0.0647361055 -0.0483023368 [16] -0.0356548313 -0.0266249338 -0.0492199936 -0.0147368661 -0.0289432749 [21] -0.0517070968 -0.0305397350 -0.0745384320 -0.0192795048 0.0503766796 [26] -0.0627890968 -0.0009757831 -0.0218757163 -0.0429198164 -0.0198544776 [31] -0.0299035646 -0.0281683999 0.0194867810 -0.0091951836 0.0035574465 [36] 0.0005095326 -0.0035018689 -0.0398961857 -0.0027469647 -0.0440212336 [41] -0.0381135673 -0.0517132213 -0.0366417916 -0.0357340407 -0.0159200250 [46] -0.0025865157 0.0712734562 -0.0129863727 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3jr1e1275738425.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/rcomp/tmp/4u0ih1275738425.tab") > > try(system("convert tmp/1nz351275738425.ps tmp/1nz351275738425.png",intern=TRUE)) character(0) > try(system("convert tmp/2nz351275738425.ps tmp/2nz351275738425.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.570 0.320 0.611