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(13.4,13.5,14.8,14.3,14.3,14,13.2,12.2,14.3,15.7,14.2,14.6,14.5,14.3,15.3,14.4,13.7,14.2,13.5,11.9,14.6,15.6,14.1,14.9,14.2,14.6,17.2,15.4,14.3,17.5,14.5,14.4,16.6,16.7,16.6,16.9,15.7,16.4,18.4,16.9,16.5,18.3,15.1,15.7,18.1,16.8,18.9,19,18.1,17.8,21.5,17.1,18.7,19,16.4,16.9,18.6,19.3,19.4,17.6,18.6,18.1,20.4,18.1,19.6,19.9,19.2,17.8,19.2,22,21.1,19.5) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > 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/13r5q1262163997.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/26brn1262163997.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.000000e+00 2.664305e-01 3.503791e-01 4.694778e-01 1.376509e-01 [6] 1.195963e-01 1.780034e-01 -1.239934e-01 2.545103e-02 -9.812171e-03 [11] -2.294030e-01 -1.204015e-01 -2.139949e-01 -2.069151e-01 -4.091345e-02 [16] -1.621926e-01 -1.292728e-01 9.573765e-02 -2.217578e-02 -1.406456e-02 [21] 7.238116e-05 4.794799e-02 -1.289742e-01 4.253750e-02 -1.816677e-01 [26] -1.872636e-01 -4.756347e-02 -2.140899e-01 -1.819029e-01 -9.562004e-02 [31] -2.175506e-01 -1.049663e-01 -5.776921e-02 -2.097742e-01 1.862910e-02 [36] 9.595480e-02 -1.142718e-02 1.891003e-01 1.199084e-01 8.858097e-02 [41] 2.325426e-01 6.639614e-02 7.418164e-02 1.450202e-01 6.809258e-02 [46] 3.961511e-02 4.292203e-02 -3.275700e-02 -3.186581e-02 -4.109893e-02 [51] -9.381503e-02 -5.788231e-02 -4.884823e-02 -6.209851e-02 -4.864014e-02 [56] -4.544180e-02 -2.652769e-02 -1.016503e-02 -3.600963e-03 2.216673e-04 > (mypacf <- c(rpacf$acf)) [1] 0.2664305231 0.3007421193 0.3835243817 -0.1084851587 -0.1732561881 [6] -0.0065625126 -0.1971635570 0.0528435755 0.0357514865 -0.1399514963 [11] -0.1172329265 -0.1652299607 0.0789613697 0.2177391661 0.0329206304 [16] -0.0970127604 0.0523387634 0.0686510989 -0.0346473049 -0.2018898799 [21] 0.0752272645 -0.2518441869 0.0187259979 -0.1944172645 -0.1110958481 [26] 0.1121801027 -0.0665799296 0.0873793110 0.0003677872 -0.0539918928 [31] -0.0165761927 -0.0579884712 -0.0213734128 -0.0074405421 0.0915519344 [36] 0.0290406202 0.0019755042 -0.0673134433 -0.0070502626 0.0037480346 [41] 0.0613908260 -0.0426147402 0.0065285725 -0.0290844989 -0.0158721956 [46] -0.0400677546 0.0037607616 -0.0072436642 -0.1217058982 0.0355963157 [51] 0.0302979391 -0.0295376185 -0.0554665941 -0.0955763157 -0.0119194940 [56] 0.0288638055 0.0013623091 -0.0810559095 0.0795291272 > 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/3io6j1262163998.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/4jwnw1262163998.tab") > > try(system("convert tmp/13r5q1262163997.ps tmp/13r5q1262163997.png",intern=TRUE)) character(0) > try(system("convert tmp/26brn1262163997.ps tmp/26brn1262163997.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.606 0.314 1.392