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(589,561,640,656,727,697,640,599,568,577,553,582,600,566,653,673,742,716,660,617,583,587,565,598,628,618,688,705,770,736,678,639,604,611,594,634,658,622,709,722,782,756,702,653,615,621,602,635,677,635,736,755,811,798,735,697,661,667,645,688,713,667,762,784,837,817,767,722,681,687,660,698,717,696,775,796,858,826,783,740,701,706,677,711,734,690,785,805,871,845,801,764,725,723,690,734,750,707,807,824,886,859,819,783,740,747,711,751,804,756,860,878,942,913,869,834,790,800,763,800,826,799,890,900,961,935,894,855,809,810,766,805,821,773,883,898,957,924,881,837,784,791,760,802,828,778,889,902,969,947,908,867,815,812,773,813,834,782,892,903,966,937,896,858,817,827,797,843) > 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/1arzz1275131279.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/2arzz1275131279.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.89157378 0.77817897 0.62027149 0.48666361 0.42814810 [7] 0.37606367 0.41477252 0.45425153 0.56181499 0.68655906 0.76855255 [13] 0.84491352 0.74498717 0.63766681 0.48967860 0.36355484 0.30594908 [19] 0.25490794 0.28742069 0.32056924 0.41651576 0.52871253 0.60335907 [25] 0.67280097 0.58270128 0.48796066 0.35453808 0.23992328 0.18771556 [31] 0.14097439 0.16925395 0.19635707 0.28118946 0.38275117 0.45109427 [37] 0.51635520 0.43481720 0.34682606 0.22371126 0.11572594 0.06292505 [43] 0.01602243 0.03722398 0.05647000 0.12965180 0.21927390 0.27882857 [49] 0.33672626 0.26246446 0.18219159 0.07128530 -0.02431847 -0.07165133 [55] -0.11241614 -0.09342230 -0.07727141 -0.01052147 0.07080935 0.12766230 [61] 0.18203276 > (mypacf <- c(rpacf$acf)) [1] 0.891573776 -0.081546287 -0.281767100 0.032215934 0.350259686 [6] -0.082227647 0.283481987 0.091875867 0.399090939 0.304474053 [11] 0.062731944 0.222364587 -0.631848813 -0.016036769 0.072911832 [16] -0.040095129 -0.086776510 -0.037423943 -0.046170953 0.029032511 [21] 0.035832960 0.051950617 0.046563486 0.045898689 -0.182006287 [26] 0.081966239 0.056122975 -0.034229717 -0.036460806 0.001647425 [31] -0.055693206 -0.008490854 -0.013836462 0.029164106 0.002533433 [36] 0.007252023 -0.105765278 -0.017088102 0.039184441 -0.032259683 [41] -0.081585608 0.006218213 -0.031590754 -0.032538421 -0.017694924 [46] -0.013027527 -0.033005481 -0.009453342 -0.028985023 0.003650462 [51] 0.037393449 0.025724285 -0.046757620 0.029342873 -0.015943919 [56] -0.010163603 0.014613243 -0.018843440 0.007076763 -0.018559730 > 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/3o1w81275131279.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/4s1dd1275131279.tab") > > try(system("convert tmp/1arzz1275131279.ps tmp/1arzz1275131279.png",intern=TRUE)) character(0) > try(system("convert tmp/2arzz1275131279.ps tmp/2arzz1275131279.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.690 0.530 1.146