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(16,29,22,30,20,39,18,9.6,10.2,20.2,50,120,19.8,18,3,11,15,27,28,14,5.6,6.5,8.5,87.9,5.8,25.2,7.5,13.7,34,17,9,9.2,5,24,40,86.5,0.54,14,4.8,28,16,5.8,16,9.1,6,17,26,99.6,41,72,23,42,40,18,45,18,2,10,13.6,160) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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/1jqgl1292066582.ps",horizontal=F,onefile=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/2czy61292066582.ps",horizontal=F,onefile=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.0000000000 0.4342391742 0.1424494586 -0.0008840689 -0.0291707862 [6] 0.1924182575 0.1488765092 0.1484780400 0.0805389277 0.0405716255 [11] 0.1573493999 -0.0243638556 -0.1608369255 -0.1081887557 0.0428955402 [16] 0.1882139358 0.1270911627 0.0257586023 -0.0587704121 -0.1393627447 [21] 0.0527505581 0.0685397270 -0.0097252927 0.0266324154 -0.0300972197 [26] -0.0418913182 -0.0958189785 -0.1609729089 -0.1316440840 -0.1431618113 [31] -0.1245673814 -0.0305660178 -0.1255787773 -0.0908598391 -0.0764948170 [36] -0.1206935165 -0.1343655177 -0.1873493578 -0.1064201998 -0.0807631445 [41] -0.0329883644 0.0203694144 -0.0237011032 0.0094101515 -0.0437496335 [46] -0.0566364971 -0.0422903648 0.0053307938 > (mypacf <- c(rpacf$acf)) [1] 0.434239174 -0.056830338 -0.051406778 -0.002119750 0.265030083 [6] -0.049524768 0.083839712 -0.003937368 0.048162586 0.121777858 [11] -0.203050712 -0.171655888 0.063166718 0.153295529 0.027205645 [16] -0.025866195 0.012509076 0.018079063 -0.112867045 0.118110510 [21] -0.017268158 -0.058141724 0.049995991 -0.069550210 -0.112739937 [26] -0.018496466 -0.050322547 -0.057672639 -0.044568125 -0.154108483 [31] 0.069606337 -0.059789073 0.055729306 -0.007710630 -0.057488133 [36] -0.089990829 -0.076605469 -0.032409821 -0.004472974 0.051593385 [41] -0.003657934 0.073245118 0.044178139 -0.051856746 0.006787395 [46] 0.021598485 0.088191769 > 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/3f0ec1292066582.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/4j0uh1292066582.tab") > try(system("convert tmp/1jqgl1292066582.ps tmp/1jqgl1292066582.png",intern=TRUE)) character(0) > try(system("convert tmp/2czy61292066582.ps tmp/2czy61292066582.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.576 0.326 1.499