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(-15,-15,-10,-12,-11,-11,-17,-18,-19,-22,-24,-24,-20,-25,-22,-17,-9,-11,-13,-11,-9,-7,-3,-3,-6,-4,-8,-1,-2,-2,-1,1,2,2,-1,1,-1,-8,1,2,-2,-2,-2,-2,-6,-4,-5,-2,-1,-5,-9,-8,-14,-10,-11,-11,-11,-5,-2,-3,-6,-6,-7,-6,-2,-2,-4,0,-6,-4,-3,-1,-3) > 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/html/rcomp/tmp/1z5sb1272722874.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/2z5sb1272722874.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.877822924 0.792026846 0.733791044 0.667745105 [6] 0.602968364 0.547422146 0.476394907 0.397708720 0.313611535 [11] 0.250306903 0.187034100 0.109712598 0.045902674 -0.038023427 [16] -0.090430471 -0.125044883 -0.163359462 -0.187227474 -0.224241027 [21] -0.267676160 -0.312348660 -0.298630137 -0.267226406 -0.254840739 [26] -0.254180224 -0.221097493 -0.240123459 -0.230383610 -0.220321488 [31] -0.207203744 -0.164858659 -0.158452939 -0.139375141 -0.114046846 [36] -0.089741070 -0.037962548 -0.013151481 -0.018880717 0.008039048 [41] 0.030172467 0.050992925 0.073082579 0.066052316 0.041702884 [46] 0.009360295 -0.017786146 -0.044363636 -0.054847388 > (mypacf <- c(rpacf$acf)) [1] 0.8778229239 0.0935102144 0.0943632431 -0.0315438501 -0.0227796971 [6] 0.0001265335 -0.0916317043 -0.0907107597 -0.1068881516 0.0110694330 [11] -0.0368742540 -0.1009516110 -0.0211827663 -0.1494335497 0.0620071903 [16] 0.0312391411 -0.0169647108 0.0379717156 -0.0858919041 -0.0600488222 [21] -0.1088843508 0.1882172320 0.1086711856 -0.0159267923 -0.0519985707 [26] 0.0740695856 -0.1937404239 0.0217094481 -0.0919580358 0.0181220699 [31] 0.1645024942 -0.1169829231 0.0319617214 -0.0385725557 0.0071725777 [36] 0.1701511718 -0.0573821853 -0.0787273737 0.0674710044 0.0346322107 [41] -0.0568912534 -0.0568811872 -0.0608981623 -0.1172846513 -0.0194472347 [46] -0.1100566380 -0.0286527018 0.0377403424 > 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/3dfqk1272722874.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/4oo7n1272722874.tab") > > try(system("convert tmp/1z5sb1272722874.ps tmp/1z5sb1272722874.png",intern=TRUE)) character(0) > try(system("convert tmp/2z5sb1272722874.ps tmp/2z5sb1272722874.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.588 0.330 0.797