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(6550,8728,12026,14395,14587,13791,9498,8251,7049,9545,9364,8456,7237,9374,11837,13784,15926,13821,11143,7975,7610,10015,12759,8816,10677,10947,15200,17010,20900,16205,12143,8997,5568,11474,12256,10583,10862,10965,14405,20379,20128,17816,12268,8642,7962,13932,15936,12628,12267,12470,18944,21259,22015,18581,15175,10306,10792,14752,13754,11738,12181,12965,19990,23125,23541,21247,15189,14767,10895,17130,17697,16611,12674,12760,20249,22135,20677,19933,15388,15113,13401,16135,17562,14720,12225,11608,20985,19692,24081,22114,14220,13434,13598,17187,16119,13713,13210,14251,20139,21725,26099,21084,18024,16722,14385,21342,17180,14577) > 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/1qih11272740747.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/2j9gm1272740747.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.15603981 -0.11402997 -0.43559578 -0.33076366 0.16793945 [7] 0.17433724 0.14191284 -0.33628985 -0.39329857 -0.17419544 0.30832708 [13] 0.70712978 0.20757689 -0.11358315 -0.38712858 -0.32589644 0.24891822 [19] 0.09330715 0.16632750 -0.34521351 -0.35185656 -0.13309853 0.29922092 [25] 0.58812189 0.17797240 -0.04404610 -0.40389669 -0.19893943 0.15180724 [31] 0.12394772 0.07729323 -0.25463830 -0.36381840 -0.05712808 0.23692536 [37] 0.52444461 0.12985180 -0.05578274 -0.32290809 -0.15957287 0.15252134 [43] 0.07460567 0.10130879 -0.26166691 -0.26775825 -0.06185896 0.21664955 [49] 0.35876665 > (mypacf <- c(rpacf$acf)) [1] 0.1560398060 -0.1418317756 -0.4112313676 -0.2797368749 0.1801313977 [6] -0.0835616622 -0.1160439352 -0.4183633756 -0.3910285485 -0.4250513517 [11] -0.1875126367 0.3436203555 0.0607342578 -0.0437356920 0.1007014546 [16] -0.1696236683 0.1850478288 -0.2058545215 0.0346291588 -0.0973258998 [21] 0.0782853493 -0.0791720608 0.0327737956 -0.0364882608 0.0226105895 [26] 0.0692907342 0.0943935303 0.0056807319 0.0563833940 -0.0211860627 [31] -0.0480281180 0.0969507257 0.0056281856 -0.0069534292 0.0560671098 [36] 0.0699711032 -0.0672877599 -0.0754369592 0.0636896300 -0.0588310220 [41] 0.0711489743 -0.0262571453 0.0305049237 0.0780956852 0.0893796970 [46] 0.0377410697 -0.0000863526 -0.1155184171 > 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/34rea1272740747.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/48svg1272740747.tab") > > try(system("convert tmp/1qih11272740747.ps tmp/1qih11272740747.png",intern=TRUE)) character(0) > try(system("convert tmp/2j9gm1272740747.ps tmp/2j9gm1272740747.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.592 0.328 2.758