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(98.8,100.5,110.4,96.4,101.9,106.2,81,94.7,101,109.4,102.3,90.7,96.2,96.1,106,103.1,102,104.7,86,92.1,106.9,112.6,101.7,92,97.4,97,105.4,102.7,98.1,104.5,87.4,89.9,109.8,111.7,98.6,96.9,95.1,97,112.7,102.9,97.4,111.4,87.4,96.8,114.1,110.3,103.9,101.6,94.6,95.9,104.7,102.8,98.1,113.9,80.9,95.7,113.2,105.9,108.8,102.3,99,100.7,115.5,100.7,109.9,114.6,85.4,100.5,114.8,116.5,112.9,102,106,105.3,118.8,106.1,109.3,117.2,92.5,104.2,112.5,122.4,113.3,100,110.7,112.8,109.8,117.3,109.1,115.9,96,99.8,116.8,115.7,99.4,94.3,91,93.2,103.1,94.1,91.8,102.7,82.6,89.1,104.5) > par7 = '0.95' > par6 = 'White Noise' > par5 = '6' > par4 = '1' > 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/html/rcomp/tmp/19jzy1260721086.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/html/rcomp/tmp/2ba1z1260721086.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.465845928 -0.172680649 0.057678022 0.106294468 [6] 0.419629829 -0.829295969 0.344219729 0.198635336 -0.035629233 [11] -0.147421631 -0.334929882 0.732517114 -0.321194973 -0.177427428 [16] 0.042708260 0.115462269 0.309280331 -0.655581985 0.272787234 [21] 0.173555351 -0.037423761 -0.131086746 -0.231072123 0.560520490 [26] -0.262327371 -0.108945858 0.001754159 0.097744482 0.274994654 [31] -0.566930755 0.253249144 0.134517731 -0.063015524 -0.042794265 [36] -0.256401403 0.493423277 -0.207542457 -0.138748133 0.057045667 [41] 0.057200090 0.209708750 -0.452797156 0.191587771 0.139254455 [46] -0.069511868 -0.038911542 -0.188851955 0.393966441 -0.145819391 [51] -0.136595544 0.042317561 0.082978906 0.141302110 -0.367151789 [56] 0.171623702 0.089085628 -0.022824303 -0.072002222 -0.158564305 [61] 0.360944366 > (mypacf <- c(rpacf$acf)) [1] -0.4658459281 -0.4977002093 -0.5002272117 -0.4943864104 0.6653239990 [6] -0.1680116758 -0.1385011153 -0.2970066507 0.1154940841 -0.1083299759 [11] -0.0112639430 0.1148113481 0.0068904873 -0.0464621132 0.0387476665 [16] -0.0656269724 -0.0339496224 -0.0480719861 0.0044585448 -0.1015340628 [21] 0.0356745018 -0.0942123696 0.1175744283 0.0468868181 -0.0068832704 [26] 0.0370667036 0.0556403343 -0.2182963740 0.1523887350 -0.0596483160 [31] 0.0001225483 0.0205560087 0.0572544375 -0.1142315931 0.0524313254 [36] -0.0020453605 0.0291100715 -0.0888769654 0.0066447235 -0.0268875383 [41] -0.0124269406 -0.0909845863 -0.0997052357 -0.0849160837 0.0360328480 [46] 0.0542582428 0.1814665516 0.0234913557 0.0087305525 0.0661880617 [51] -0.0386974056 -0.0308762724 0.0553927792 -0.0493172755 -0.0428734378 [56] 0.0278350902 -0.0029132987 -0.0214164636 -0.0394250480 -0.0517067590 > 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/3g4gj1260721086.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/4jl2a1260721086.tab") > > try(system("convert tmp/19jzy1260721086.ps tmp/19jzy1260721086.png",intern=TRUE)) character(0) > try(system("convert tmp/2ba1z1260721086.ps tmp/2ba1z1260721086.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.584 0.308 0.683