R version 2.8.0 (2008-10-20) 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 = '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: 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/freestat/rcomp/tmp/1t3rg1229074905.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/freestat/rcomp/tmp/2edu51229074905.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.119987789 -0.274192878 0.156936413 0.007827587 [6] -0.065144079 0.121537603 -0.051345594 0.028398670 0.165631583 [11] -0.242998954 0.135033496 0.782015358 0.049453369 -0.261568296 [16] 0.141240139 0.001200140 -0.085836291 0.067847392 -0.089153009 [21] 0.004818176 0.109832736 -0.260359682 0.084339303 0.626639954 [26] 0.014039190 -0.285247947 0.038389435 -0.016442247 -0.104209420 [31] 0.010879136 -0.091813097 -0.037745928 0.010702542 -0.269722326 [36] 0.041028156 0.512225212 -0.019257161 -0.284988130 -0.009273807 [41] -0.049339153 -0.130980446 -0.013730796 -0.070456990 -0.075216163 [46] -0.023242309 -0.252874097 0.004379608 0.417984568 -0.031611534 [51] -0.260080901 -0.004581124 -0.038017086 -0.123454022 -0.023105083 [56] -0.075446089 -0.080796033 -0.019251564 -0.185396416 0.018547304 [61] 0.360853176 > (mypacf <- c(rpacf$acf)) [1] 0.1199877891 -0.2928054889 0.2603506374 -0.1798494171 0.1214826822 [6] 0.0204877451 -0.0706916403 0.1553457396 0.0246441539 -0.2459802011 [11] 0.4223622855 0.6405335494 -0.0662391052 0.0215513583 -0.0173315966 [16] 0.0196583881 -0.0635774708 -0.1170871442 -0.1100624387 -0.1053833170 [21] -0.1266122735 -0.1478404640 -0.1373177205 0.0296165660 0.0242045989 [26] -0.0978090592 -0.1863247991 0.0519455228 -0.0205162586 0.0150015453 [31] 0.0506853801 -0.0578826304 -0.0710266188 0.0071316303 -0.0333830733 [36] 0.0797138003 -0.0365411764 0.1060649406 -0.0120397262 -0.0622892498 [41] -0.0074330065 0.0641792896 0.0599318489 -0.0470984914 0.0357010539 [46] -0.0448281490 -0.0258648188 0.0010206834 -0.0569225064 0.0400475740 [51] 0.0329181596 0.0094130108 -0.0031132225 -0.0668369346 -0.0108189427 [56] -0.0091349973 -0.0006102226 0.1005922181 -0.0134781192 0.0014826074 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/37y6z1229074905.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/freestat/rcomp/tmp/4ept81229074905.tab") > > system("convert tmp/1t3rg1229074905.ps tmp/1t3rg1229074905.png") > system("convert tmp/2edu51229074905.ps tmp/2edu51229074905.png") > > > proc.time() user system elapsed 0.839 0.447 1.441