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 = '1' > 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/1qp611275131383.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/20g541275131383.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.02255315 0.25625000 -0.11413194 -0.35913921 -0.05795852 [7] -0.50172705 -0.03289808 -0.34692405 -0.08174019 0.23330097 0.02810855 [13] 0.91058577 0.03050115 0.23826882 -0.10314642 -0.32952446 -0.05752692 [19] -0.46390825 -0.03139199 -0.32044021 -0.07892967 0.20804040 0.02839660 [25] 0.83251549 0.02881458 0.22216593 -0.08626000 -0.30042894 -0.05645081 [31] -0.42236212 -0.02299570 -0.29715007 -0.07935031 0.18821803 0.02160137 [37] 0.76220177 0.02460381 0.20884979 -0.07113045 -0.26437970 -0.05354143 [43] -0.38472262 -0.02209842 -0.27881355 -0.07971861 0.16615111 0.01627270 [49] 0.69897827 0.01892615 0.19464712 -0.06664089 -0.23046044 -0.04941721 [55] -0.34719729 -0.01283503 -0.25986493 -0.06793433 0.13989379 0.02015226 [61] 0.61912763 > (mypacf <- c(rpacf$acf)) [1] 0.0225531536 0.2558715017 -0.1329720644 -0.4539105534 0.0272369854 [6] -0.3623802703 -0.1709760148 -0.4424899513 -0.4635370085 -0.2386822389 [11] -0.5810546937 0.6383187584 -0.0304788807 -0.3458680130 0.0235281813 [16] 0.1856474424 -0.0114482743 0.0936072904 -0.0682377574 0.0665372016 [21] 0.0134921427 -0.0374719609 0.0232152653 0.0663336290 -0.1291516676 [26] -0.0429578252 0.0496603071 -0.0075586241 -0.0964094639 0.0110211982 [31] 0.0569091493 -0.0130811501 -0.0811837746 0.0557832614 0.0243638071 [36] -0.0198373892 -0.0317529741 0.0377651931 0.0251314446 0.0521035783 [41] -0.0001752621 0.0407342491 -0.0091638204 -0.0030841076 0.0522833529 [46] 0.0325870156 -0.0470810572 0.0245827586 -0.0007985189 -0.0269440177 [51] -0.0936559003 -0.0057947046 0.0124814250 -0.0589861608 -0.0348529110 [56] 0.0283511204 0.0501182549 -0.0466312599 0.0509898861 -0.0539534160 > 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/3mz4s1275131383.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/4p02f1275131383.tab") > > try(system("convert tmp/1qp611275131383.ps tmp/1qp611275131383.png",intern=TRUE)) character(0) > try(system("convert tmp/20g541275131383.ps tmp/20g541275131383.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.660 0.480 1.106