R version 2.10.1 (2009-12-14) 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(268,267,266,264,262,261,262,264,265,265,266,268,260,264,265,262,258,265,273,273,270,263,260,257,248,248,237,228,225,231,243,250,246,240,236,235,225,230,225,221,231,234,249,257,253,252,245,239,229,232,222,218,223,221,230,234,237,226,215,211,203,202,187,179,181,172,182,180,175,163,160,151,145,140,125,122,124,108,115,116,104,98,101,91) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > 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/rcomp/tmp/1cvq51278601532.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/rcomp/tmp/2cvq51278601532.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.948083048 0.898038214 0.842945665 0.788177831 [6] 0.742266583 0.695798239 0.644302187 0.601388788 0.558573113 [11] 0.515473503 0.478044877 0.438496366 0.392568959 0.348741431 [16] 0.303331876 0.264665176 0.232548963 0.200652048 0.162066911 [21] 0.129624443 0.098196904 0.072027145 0.054038377 0.033724275 [26] 0.013129316 -0.006563825 -0.019525653 -0.024049488 -0.025987908 [31] -0.031450495 -0.044630083 -0.057341065 -0.070839213 -0.081653455 [36] -0.085874888 -0.093865180 -0.098328227 -0.101243872 -0.100042859 [41] -0.097339075 -0.091557415 -0.092346249 -0.105785148 -0.122395028 [46] -0.144081862 -0.164335176 -0.180796549 -0.200915206 -0.215345951 [51] -0.230938593 -0.242671580 -0.249932415 -0.254979489 -0.265273569 [56] -0.284706630 -0.308796515 -0.332544756 -0.349412408 -0.357605070 [61] -0.365840822 > (mypacf <- c(rpacf$acf)) [1] 0.948083048 -0.008139850 -0.075963001 -0.028464143 0.059895999 [6] -0.029189251 -0.086831110 0.053887685 -0.010041596 -0.041218609 [11] 0.018654119 -0.029828472 -0.096073027 -0.021335310 -0.025175597 [16] 0.029877650 0.020518147 -0.018432783 -0.098955361 0.025495259 [21] 0.003928788 0.007799659 0.041922439 -0.026856883 -0.026405615 [26] -0.019309483 0.068775668 0.055243599 -0.011082655 -0.040245019 [31] -0.078556500 -0.003902260 -0.012759449 -0.011182650 0.039894856 [36] -0.040815773 0.024014923 0.006678859 0.035205965 -0.019870635 [41] 0.003381864 -0.040098493 -0.127839981 -0.033133547 -0.057381371 [46] -0.035402045 -0.001883383 -0.040271660 0.045511825 -0.039927435 [51] 0.011890527 0.002363912 -0.010459974 -0.036550057 -0.120792909 [56] -0.053760695 -0.032295510 0.008293822 0.050967468 -0.018281182 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3qn5d1278601532.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/rcomp/tmp/41w5y1278601532.tab") > > try(system("convert tmp/1cvq51278601532.ps tmp/1cvq51278601532.png",intern=TRUE)) character(0) > try(system("convert tmp/2cvq51278601532.ps tmp/2cvq51278601532.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.590 0.360 0.645