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.61,1.58,1.69,1.78,1.76,1.83,1.8,1.57,1.45,1.4,1.55,1.58,1.58,1.59,1.8,1.99,2.06,2.06,2.08,2,1.85,1.77,1.7,1.66,1.67,1.73,1.91,2.02,2.07,2.15,2.1,1.68,1.68,1.65,1.72,1.73,1.76,1.84,1.99,2.05,2.12,2.13,2.08,1.88,1.81,1.81,1.88,1.87,1.87,1.9,2.01,2.05,2.16,2.18,2.15,2.12,2.04,2.04,2.06,1.93,1.86,1.94,2.35,2.46,2.59,2.66,2.41,2.18,2.13,2.11,2.12,2.16,2.07,2.2,2.29,2.32,2.37,2.38,2.38,2.28,2.22,2.25,2.3,2.3,2.23,2.27,2.3,2.32,2.41,2.43,2.45,2.47,2.46,2.5,2.46,2.43,2.37,2.45,2.53,2.56,2.62,2.67,2.62,2.6,2.53,2.49,2.48,2.44) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/html/rcomp/tmp/107pi1260971895.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/22s5v1260971895.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.39305618 0.03569464 -0.14474410 -0.27383550 -0.35497194 [7] -0.32045059 -0.28927269 -0.12341877 -0.05779259 0.08940664 0.33017553 [13] 0.50070470 0.27300574 0.03808243 -0.08541527 -0.12084876 -0.24437355 [19] -0.20963634 -0.24004939 -0.13553475 -0.16641532 0.01819115 0.32324166 [25] 0.45216110 0.21559840 0.06750889 -0.00577489 -0.05303020 -0.16141679 [31] -0.18511846 -0.32644240 -0.19924974 -0.14329652 -0.02998629 0.34330975 [37] 0.46671240 0.22057986 0.08039807 -0.01296656 -0.13695887 -0.14627825 [43] -0.23977134 -0.17662609 -0.08694990 -0.08920047 0.05831598 0.23661392 [49] 0.25970670 > (mypacf <- c(rpacf$acf)) [1] 0.393056177 -0.140505685 -0.127312815 -0.194411176 -0.229866061 [6] -0.185744349 -0.269379952 -0.148653145 -0.303305053 -0.196351617 [11] 0.002806523 0.170977607 -0.101667541 -0.102673196 -0.011031648 [16] 0.087038260 -0.047836390 0.067296471 -0.108741245 -0.020761344 [21] -0.263021053 -0.085668053 0.069052050 0.050516180 -0.151266063 [26] -0.070913349 0.038247550 0.048969903 0.029833210 0.046386949 [31] -0.245522309 0.003764534 -0.036319636 -0.172219383 0.128280902 [36] 0.027515878 -0.054331898 -0.089736338 0.021383320 -0.152123248 [41] 0.068064593 -0.170757923 0.122875341 0.051039380 0.043253752 [46] 0.007728606 -0.010764284 -0.083440273 > 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/3vwpc1260971895.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/45g0h1260971895.tab") > > try(system("convert tmp/107pi1260971895.ps tmp/107pi1260971895.png",intern=TRUE)) character(0) > try(system("convert tmp/22s5v1260971895.ps tmp/22s5v1260971895.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.596 0.338 0.812