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(401,394,372,334,320,334,400,427,423,395,373,377,391,398,393,375,371,364,400,406,407,397,389,394,399,401,396,392,384,370,380,376,378,376,373,374,379,376,371,375,360,338,352,344,330,334,333,343,350,341,320,302,287,304,370,385,365,333,313,330,367) > 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/html/rcomp/tmp/1su5z1261922160.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/2677k1261922160.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.798155404 0.448935693 0.213944333 0.230062630 [6] 0.418664598 0.566073649 0.519879513 0.366989763 0.239727939 [11] 0.202900936 0.248830217 0.290175637 0.213436702 0.111331655 [16] 0.032429001 0.005146981 0.016252815 0.016399362 -0.042831831 [21] -0.109752906 -0.157390278 -0.178744196 -0.168894670 -0.154857264 [26] -0.186423038 -0.212251328 -0.219614257 -0.209964991 -0.194187363 [31] -0.199084198 -0.244777116 -0.288432541 -0.295079526 -0.256828496 [36] -0.193456998 -0.157236937 -0.196519824 -0.236381083 -0.223780388 [41] -0.159951922 -0.091728793 -0.087638593 -0.170730544 -0.240903154 [46] -0.213861310 -0.086887601 0.059753597 0.105311858 0.001061246 [51] -0.145122622 -0.204931620 -0.132577059 0.006193853 0.096202805 [56] 0.069872447 0.001409992 -0.047107560 -0.048672869 -0.022078350 [61] -0.000461404 > (mypacf <- c(rpacf$acf)) [1] 7.981554e-01 -5.183012e-01 3.149060e-01 3.702602e-01 2.038057e-01 [6] -2.446573e-02 -1.066140e-01 2.196578e-01 -6.655494e-03 -1.471895e-01 [11] 2.960717e-02 -6.916667e-03 -3.304695e-01 1.854972e-01 -1.568708e-01 [16] -1.281041e-01 -5.581396e-02 -3.374691e-06 -9.782055e-02 -5.874753e-02 [21] -2.482604e-02 7.919382e-03 -2.911819e-02 1.196883e-02 -4.048335e-03 [26] 4.995426e-02 7.566689e-02 -1.289746e-03 -3.983324e-03 -1.609342e-02 [31] -3.441566e-02 -1.045763e-01 3.505000e-02 2.295753e-02 -6.411759e-02 [36] -6.766837e-02 -4.395726e-02 1.171181e-01 2.740984e-02 -4.600603e-02 [41] 7.414763e-03 -6.562311e-02 -1.370794e-01 7.816819e-02 7.901148e-02 [46] 7.554430e-02 2.014012e-02 -4.007843e-02 -2.158177e-02 -1.196822e-01 [51] -1.232423e-02 7.024850e-03 -1.038878e-01 -2.310516e-03 3.912581e-02 [56] 6.391951e-02 -1.161953e-01 -7.202368e-02 -9.689449e-03 4.704708e-02 > 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/3w0lb1261922160.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/4hqws1261922160.tab") > > try(system("convert tmp/1su5z1261922160.ps tmp/1su5z1261922160.png",intern=TRUE)) character(0) > try(system("convert tmp/2677k1261922160.ps tmp/2677k1261922160.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.576 0.314 2.320