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(112,118,132,129,121,135,148,148,136,119,104,118,115,126,141,135,125,149,170,170,158,133,114,140,145,150,178,163,172,178,199,199,184,162,146,166,171,180,193,181,183,218,230,242,209,191,172,194,196,196,236,235,229,243,264,272,237,211,180,201,204,188,235,227,234,264,302,293,259,229,203,229,242,233,267,269,270,315,364,347,312,274,237,278,284,277,317,313,318,374,413,405,355,306,271,306,315,301,356,348,355,422,465,467,404,347,305,336,340,318,362,348,363,435,491,505,404,359,310,337,360,342,406,396,420,472,548,559,463,407,362,405,417,391,419,461,472,535,622,606,508,461,390,432) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '0.0' > par1 = '60' > #'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/1hopp1260995346.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/2zqnn1260995346.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.19975134 -0.12010433 -0.15077204 -0.32207432 -0.08397453 [7] 0.02577843 -0.11096075 -0.33672146 -0.11558631 -0.10926704 0.20585223 [13] 0.84142998 0.21508704 -0.13955394 -0.11599576 -0.27894284 -0.05170646 [19] 0.01245814 -0.11435760 -0.33717439 -0.10738490 -0.07521120 0.19947518 [25] 0.73692070 0.19726236 -0.12388430 -0.10269904 -0.21099219 -0.06535684 [31] 0.01572846 -0.11537038 -0.28925562 -0.12688236 -0.04070684 0.14741061 [37] 0.65743810 0.19290864 -0.13431247 -0.06023711 -0.16270560 -0.05802668 [43] 0.00736649 -0.11095442 -0.28526755 -0.10617644 -0.03364527 0.12402117 [49] 0.58689883 0.18653823 -0.13775391 -0.04947523 -0.12415910 -0.02898113 [55] 0.00446858 -0.09431298 -0.29173282 -0.09592193 -0.00955829 0.10345757 [61] 0.52104864 > (mypacf <- c(rpacf$acf)) [1] 0.1997513367 -0.1666545451 -0.0958754158 -0.3108908559 0.0077849143 [6] -0.0745495301 -0.2102835666 -0.4947571488 -0.1922947064 -0.5318752431 [11] -0.3022925255 0.5860413494 0.0259783575 -0.1811927039 0.1200384625 [16] 0.0004076076 0.0252602791 -0.1249890976 0.0874347248 -0.0544710878 [21] -0.0618235781 -0.0251952446 0.0333314860 -0.0096343848 -0.0480574740 [26] 0.0184867064 0.0279783480 0.0163094446 -0.0934574262 0.0084975849 [31] 0.0714613376 0.1095154908 -0.0931830943 0.0631344957 -0.0920556030 [36] 0.0584036191 -0.0102909222 -0.0760024099 0.0874056436 0.0370256762 [41] -0.0255019409 0.0479538855 -0.0041668837 -0.0348888355 0.0232004706 [46] 0.0169769241 0.0168431277 0.0634783011 -0.0416328086 0.0600896632 [51] -0.0712277343 0.0340953541 0.0882768797 -0.0124532889 0.0659899263 [56] -0.0086080000 0.0429921963 0.0841298360 0.0578572358 0.0150110625 > 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/3ewy31260995346.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/4f27t1260995346.tab") > > try(system("convert tmp/1hopp1260995346.ps tmp/1hopp1260995346.png",intern=TRUE)) character(0) > try(system("convert tmp/2zqnn1260995346.ps tmp/2zqnn1260995346.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.594 0.333 1.623