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 = '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/1idgq1272739657.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/2b4fb1272739657.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.717132639 0.358366960 0.072531911 0.028774937 [6] 0.162921846 0.203996892 0.135491558 -0.014233995 0.011292422 [11] 0.256361212 0.593878618 0.762623730 0.547679406 0.229092445 [16] -0.019789847 -0.054115048 0.094121977 0.101178861 0.048041065 [21] -0.106451020 -0.077777662 0.147874427 0.454837329 0.586793359 [26] 0.410216555 0.138984890 -0.093136320 -0.102123650 0.009928078 [31] 0.023340234 -0.044894456 -0.166576777 -0.165020961 0.052796943 [36] 0.303935748 0.421796448 0.259364283 0.027403542 -0.162226950 [41] -0.156696552 -0.066456601 -0.066456840 -0.127175723 -0.256103312 [46] -0.247930660 -0.074689637 0.138986498 0.224297778 > (mypacf <- c(rpacf$acf)) [1] 0.7171326392 -0.3209915441 -0.0843863690 0.2518168722 0.2014402323 [6] -0.2166535645 -0.0463504439 -0.0013035410 0.3246946113 0.3645522200 [11] 0.3802319230 0.1603279651 -0.3457162831 -0.0758421258 -0.0301261979 [16] -0.1296610520 0.1275958949 -0.2115720628 0.1378163632 -0.0921132296 [21] 0.0446743697 -0.0536933323 0.1107562674 -0.0454930653 0.0269574997 [26] 0.0053387316 -0.0543159550 -0.0548292360 0.0197584071 -0.0673786812 [31] 0.0056913276 0.0641104471 -0.1421734904 0.0075997169 -0.0005541467 [36] -0.0614068150 -0.0585416834 0.0456537720 0.0269494147 -0.0584522290 [41] 0.0202430557 -0.1087836240 0.0314151206 -0.0474420550 -0.0595454662 [46] -0.1082055663 0.0166272050 -0.0872045366 > 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/3w5vg1272739657.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/4hncm1272739657.tab") > > try(system("convert tmp/1idgq1272739657.ps tmp/1idgq1272739657.png",intern=TRUE)) character(0) > try(system("convert tmp/2b4fb1272739657.ps tmp/2b4fb1272739657.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.584 0.305 0.704