R version 2.9.0 (2009-04-17) 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(62,64,62,64,64,69,69,65,56,58,53,62,55,60,59,58,53,57,57,53,54,53,57,57,55,49,50,49,54,58,58,52,56,52,59,53,52,53,51,50,56,52,46,48,46,48,48,49,53,48,51,48,50,55,52,53,52,55,53,53,56,54,52,55,54,59,56,56,51,53,52,51,46,49,46,55,57,53,52,53,50,54,53,50,51,52,47,51,49,53,52,45,53,51,48,48,48,48,40,43,40,39,39,36,41,39,40,39,46,40,37,37,44,41,40,36,38,43,42,45,46) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '1' > par1 = '36' > #'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/html/rcomp/tmp/1lm0h1259325974.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/html/rcomp/tmp/2qi9i1259325974.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.6128148625 0.5576979066 0.3991154837 0.3147269348 [6] 0.2722308310 0.2391951733 0.1507262877 0.1294152918 0.0445400699 [11] -0.0002617949 -0.1063636699 -0.2767479100 -0.2372515038 -0.2237060385 [16] -0.2150540096 -0.1350776964 -0.1388002158 -0.1467692528 -0.0950585442 [21] -0.1054104978 -0.0775972081 -0.0540690138 0.0417508756 0.0334583793 [26] 0.1274591804 0.2010790711 0.2081494130 0.2023615015 0.1439684062 [31] 0.1053538155 0.0645551318 0.0273115342 0.0234703141 -0.0666574138 [36] -0.1080228933 -0.1443376580 > (mypacf <- c(rpacf$acf)) [1] 0.6128148625 0.2917023518 -0.0380096943 -0.0202041727 0.0621548799 [6] 0.0463278907 -0.0950874431 0.0008488784 -0.0646023541 -0.0562531731 [11] -0.1480263670 -0.2949298936 0.0880862735 0.1253861146 -0.0440819484 [16] 0.0777692982 0.0491523838 -0.0390874232 0.0419046314 -0.0029244890 [21] -0.0153570104 0.0200427086 0.1168988573 -0.1693126671 0.1034385324 [26] 0.2401843059 -0.0638865370 -0.0159212653 -0.0758293163 -0.0992055271 [31] -0.0342439005 -0.0807249845 -0.0682139247 -0.1131723535 0.0079163148 [36] -0.1317697383 > 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/3t3xd1259325974.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/4bbkw1259325974.tab") > > system("convert tmp/1lm0h1259325974.ps tmp/1lm0h1259325974.png") > system("convert tmp/2qi9i1259325974.ps tmp/2qi9i1259325974.png") > > > proc.time() user system elapsed 0.543 0.302 0.636