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(1.77,1.76,1.77,1.95,1.98,1.93,1.94,1.92,1.94,1.92,1.92,1.94,1.91,1.88,1.98,2.4,2.47,2.22,1.98,1.89,1.87,1.88,1.86,1.81,1.79,1.78,1.73,1.88,1.91,1.9,1.84,1.85,1.83,1.82,1.82,1.81,1.75,1.74,1.73,1.96,2.07,1.96,1.87,1.84,1.81,1.78,1.72,1.73,1.64,1.61,1.63,1.92,1.88,1.68,1.58,1.49,1.46,1.44,1.44,1.42,1.4,1.38,1.36,1.48,1.56,1.51,1.51,1.42,1.4,1.38,1.35,1.29) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > 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/1ln1h1261082067.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/2439q1261082067.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.885602256 0.725351503 0.615269567 0.563435622 [6] 0.531318666 0.506565787 0.475893043 0.447626383 0.418282875 [11] 0.403799320 0.422022245 0.421487248 0.329905240 0.214486733 [16] 0.127977693 0.074999595 0.039094039 0.013533523 -0.006959634 [21] -0.007895645 0.008252102 0.020098063 0.056683505 0.081131963 [26] 0.044429987 -0.022606037 -0.067218926 -0.089975148 -0.099388539 [31] -0.109511417 -0.111801902 -0.101262742 -0.093569941 -0.083723442 [36] -0.052766218 -0.047577651 > (mypacf <- c(rpacf$acf)) [1] 0.8856022564 -0.2732382575 0.1971713691 0.1113634713 0.0145625972 [6] 0.0754500075 -0.0104072290 0.0491786999 -0.0112367254 0.0840609753 [11] 0.1490743345 -0.1232893104 -0.3405576655 0.0199441745 -0.0697209675 [16] -0.0798156940 -0.0257880951 -0.0080758706 0.0031980742 0.0907890666 [21] 0.1146332194 -0.0263467727 0.1696653059 -0.0001219764 -0.0866981191 [26] -0.0259677130 0.0156947374 -0.0783824586 -0.0433560274 -0.0561453176 [31] 0.0065028267 -0.0634611482 -0.0743758000 0.0869653083 -0.0044835530 [36] -0.1322536275 > 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/315al1261082067.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/4k0cm1261082067.tab") > > try(system("convert tmp/1ln1h1261082067.ps tmp/1ln1h1261082067.png",intern=TRUE)) character(0) > try(system("convert tmp/2439q1261082067.ps tmp/2439q1261082067.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.545 0.324 0.665