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(296.95,296.84,287.54,287.81,283.99,275.79,269.52,278.35,283.43,289.46,282.30,293.55,304.78,300.99,315.29,316.21,331.79,329.38,317.27,317.98,340.28,339.21,336.71,340.11,347.72,328.68,303.05,299.83,320.04,317.94,303.31,308.85,319.19,314.52,312.39,315.77,320.23,309.45,296.54,297.28,301.39,306.68,305.91,314.76,323.34,341.58,330.12,318.16,317.84,325.39,327.56,329.77,333.29,346.10,358.00,344.82,313.30,301.26,306.38,319.31) > par7 = '0.95' > par6 = 'White Noise' > par5 = '4' > 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/html/rcomp/tmp/1ebb71291989662.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/2ebb71291989662.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.000000000 0.847945033 0.636006674 0.525772325 0.473921534 [6] 0.346650328 0.210828951 0.162369822 0.154134916 0.055149723 [11] -0.086959353 -0.178826393 -0.225735922 -0.284194154 -0.354480638 [16] -0.366352153 -0.328942508 -0.290604024 -0.267162496 -0.205962417 [21] -0.122842987 -0.060514127 -0.039888717 -0.015508995 0.024252989 [26] 0.075708917 0.087931618 0.096805815 0.132983661 0.213573720 [31] 0.267650583 0.262538795 0.213859302 0.180086314 0.140077012 [36] 0.081463675 0.037720441 0.022751333 -0.008614842 -0.081496332 [41] -0.156405972 -0.199840543 -0.222605935 -0.251223555 -0.270980759 [46] -0.266787448 -0.248941625 -0.242037489 -0.242450471 -0.220336812 [51] -0.168740072 -0.127450288 -0.099518759 -0.075834974 -0.042268443 [56] -0.009124538 0.009543236 0.006658738 0.000553481 -0.004305195 > (mypacf <- c(rpacf$acf)) [1] 0.847945033 -0.295399605 0.302755403 -0.034168036 -0.297214078 [6] 0.125463861 0.083988970 -0.087160375 -0.244068935 -0.024249911 [11] -0.103217634 -0.110730631 0.034880895 -0.086560415 0.044755753 [16] -0.008080812 0.069354152 0.030200532 0.127317663 0.006880140 [21] -0.004682268 -0.021692140 -0.036621346 -0.028689913 0.077654189 [26] -0.153925617 0.038304654 0.060589693 0.188352526 0.002622840 [31] -0.014070681 -0.098185259 -0.005560933 -0.039587114 0.012588183 [36] 0.063963147 -0.113847537 -0.168401545 -0.046941179 -0.032552722 [41] 0.001884525 0.050845368 0.058262372 -0.080023464 0.033045505 [46] 0.029712184 0.024089611 -0.078293702 0.004834520 -0.057576644 [51] -0.060269046 0.009471752 -0.062774457 -0.055284903 0.024192290 [56] -0.050064610 -0.017716428 -0.031561162 -0.039346676 > 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/3alqf1291989662.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/43uqi1291989662.tab") > > try(system("convert tmp/1ebb71291989662.ps tmp/1ebb71291989662.png",intern=TRUE)) character(0) > try(system("convert tmp/2ebb71291989662.ps tmp/2ebb71291989662.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.637 0.360 6.175