R version 2.7.0 (2008-04-22) Copyright (C) 2008 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(293,301,362,330,328,405,232,159,336,361,329,339,290,328,375,294,340,364,248,145,380,305,291,319,334,318,362,296,300,342,215,185,343,333,316,252,320,324,343,295,301,367,196,182,342,361,334,330,345,323,366,323,316,358,235,169,430,409,407,341,326,374,364,349,300,385,304,196,443,414,325,388,356,386,444,387,327,448,225,182,460,411,342,361,377,331,428,340,352,461,221,198,422,329,320,375,364,351,380,319,322,386,221,187,344,342,365,313,356,337,389,326,343,357,220,218,391,425,332,298) > 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: Write here your technical program description (don't use hard returns!) > 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 (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/1md4j1229075168.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x,par1,main='Autocorrelation',xlab='lags',ylab='ACF') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2s49q1229075168.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.084354417 0.116116563 0.107376463 -0.026661352 [6] 0.121595057 0.199409217 0.177163835 0.171239111 0.177829183 [11] 0.065018033 0.177070525 -0.154657767 -0.012916452 0.121130687 [16] 0.151092979 -0.016968645 0.056865108 0.019334389 -0.113359125 [21] 0.060698559 -0.021385128 -0.119275356 0.030333082 -0.155882902 [26] -0.033342956 -0.042814441 -0.140592585 -0.065840704 -0.114287605 [31] -0.131730186 -0.136455583 -0.060416879 -0.137037142 0.010424080 [36] -0.125423935 -0.210160012 -0.142082506 -0.097193096 -0.176774922 [41] -0.016047785 -0.021628019 -0.133572708 0.053692582 -0.112521674 [46] -0.117852514 -0.193440713 -0.149443566 -0.008739999 0.021975904 [51] 0.005095594 -0.039758627 -0.080196177 -0.074719150 -0.071443881 [56] 0.026864537 -0.020741258 -0.010013479 0.082660675 0.035707456 [61] -0.015090775 > (mypacf <- c(rpacf$acf)) [1] 0.084354417 0.109782068 0.091135270 -0.054782552 0.108707000 [6] 0.189858387 0.147490776 0.103165162 0.129382614 0.024988112 [11] 0.132411188 -0.261376794 -0.111343081 0.041006402 0.128057049 [16] -0.199273025 -0.058494892 0.055480943 -0.058849162 0.002306116 [21] -0.008335131 -0.147627325 0.091940374 -0.224978884 -0.054324143 [26] -0.034321990 0.046648666 -0.103307834 -0.111905950 0.010898174 [31] -0.057250259 0.025357227 0.008732564 0.074577095 0.012396899 [36] -0.212080959 -0.048832978 0.050832170 -0.039756760 -0.015265175 [41] 0.004132509 0.062107929 0.104026508 0.013734868 -0.037691722 [46] -0.149537176 -0.034128689 -0.100954919 -0.057609819 0.077798003 [51] -0.043390768 -0.080115067 0.038122826 -0.009743917 0.079335675 [56] 0.027426084 -0.006680126 -0.054912879 0.045170947 -0.082020636 > 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/3ygm01229075168.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/42cg31229075169.tab") > > system("convert tmp/1md4j1229075168.ps tmp/1md4j1229075168.png") > system("convert tmp/2s49q1229075168.ps tmp/2s49q1229075168.png") > > > proc.time() user system elapsed 2.781 0.916 2.953