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(2.14,2.45,2.52,2.3,2.25,2.06,1.99,2.25,2.26,2.36,2.3,2.19,2.31,2.21,2.21,2.26,2.18,2.21,2.33,2.12,2.08,1.97,2.09,2.11,2.24,2.45,2.68,2.73,2.76,2.83,3.16,3.22,3.22,3.34,3.35,3.42,3.58,3.71,3.68,3.83,3.94,3.88,4.03,4.15,4.32,4.4,4.37,4.14,4.11,4.16,3.98,4.13,3.76,3.66,3.85,4.03,4.31,4.58,4.46,4.41,3.84,2.84,2.66,2.17,1.43,1.47,1.29,1.23,1.09,0.94,0.76,0.67) > 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/html/rcomp/tmp/14ftx1260699175.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/2h8vj1260699175.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.423079075 0.305406455 0.349410360 -0.019355777 [6] 0.038358604 0.081887446 -0.048529239 0.113232547 0.082731097 [11] 0.011955795 0.157774391 0.070006870 0.049695032 0.133808741 [16] 0.013794572 0.021220261 0.008536035 0.001246706 -0.049914397 [21] -0.061996057 -0.067173027 -0.100785818 -0.027031725 -0.086988633 [26] -0.090207758 -0.051731815 -0.087159058 -0.076151732 0.002429249 [31] -0.082928404 -0.102875206 -0.044414469 -0.077923588 -0.162984525 [36] -0.142726987 -0.128161856 -0.122315472 -0.148631924 -0.086367509 [41] -0.085410375 -0.009386231 0.042035162 -0.043631519 0.007901887 [46] -0.015511361 -0.111473709 0.058212800 0.022171074 -0.014851759 [51] 0.055910553 -0.081110136 -0.089187131 -0.022943870 -0.075553596 [56] 0.041659967 0.037015258 -0.017288566 0.073875610 -0.044268497 [61] -0.068807437 > (mypacf <- c(rpacf$acf)) [1] 0.4230790748 0.1539706705 0.2182699568 -0.3251293282 0.0726315187 [6] 0.0501941541 0.0112757808 0.1043113662 -0.0273587227 -0.0066507274 [11] 0.0934322542 -0.0001385765 0.0204262890 0.0222690161 -0.0289263458 [16] -0.0055184473 -0.0674267874 0.1065888102 -0.1435459542 -0.0130571537 [21] -0.0493578831 -0.0341504049 0.0783848979 -0.1273475979 -0.0061891496 [26] -0.0556270681 0.0255932134 -0.0098349987 0.0484921464 -0.0802805951 [31] -0.0729632083 0.0099004488 0.0907210823 -0.2095546755 -0.0293722196 [36] 0.0022597511 0.0353432305 -0.1024895830 0.0188109920 -0.0179418674 [41] 0.0902510439 0.0757440094 -0.1367974974 0.0216926313 -0.0080522529 [46] -0.0344691134 0.1574887810 0.0137140219 -0.0016133803 -0.1180517992 [51] -0.0969910684 0.0331132026 0.0000392258 0.0764562413 -0.0213520821 [56] -0.1009656015 0.0600702226 -0.0389517572 -0.0701751303 -0.0709755076 > 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/3zh7c1260699175.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/4wi1v1260699175.tab") > > try(system("convert tmp/14ftx1260699175.ps tmp/14ftx1260699175.png",intern=TRUE)) character(0) > try(system("convert tmp/2h8vj1260699175.ps tmp/2h8vj1260699175.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.591 0.316 1.533