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(119.5,125,145,105.3,116.9,120.1,88.9,78.4,114.6,113.3,117,99.6,99.4,101.9,115.2,108.5,113.8,121,92.2,90.2,101.5,126.6,93.9,89.8,93.4,101.5,110.4,105.9,108.4,113.9,86.1,69.4,101.2,100.5,98,106.6,90.1,96.9,125.9,112,100,123.9,79.8,83.4,113.6,112.9,104,109.9,99,106.3,128.9,111.1,102.9,130,87,87.5,117.6,103.4,110.8,112.6,102.5,112.4,135.6,105.1,127.7,137,91,90.5,122.4,123.3,124.3,120,118.1,119,142.7,123.6,129.6,151.6,110.4,99.2,130.5,136.2,129.7,128) > 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/119461228999073.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/21q0o1228999073.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.0000000000 0.2883197708 0.3545569775 0.2721617989 0.2029162073 [6] 0.1380805001 0.2823679943 0.0932103375 0.2512947550 0.3175791319 [11] 0.2142517410 0.2720455945 -0.0761162923 0.0730628074 0.0867467883 [16] 0.0454795253 0.0669107776 0.2018417344 0.0551562622 0.1546320357 [21] 0.1511705204 -0.0342539238 -0.0893505337 -0.0003318703 0.0199676462 [26] -0.0319375299 0.0986273725 0.0050247736 0.0374707326 0.0172952787 [31] 0.0036590123 -0.1145623454 -0.0591925372 -0.0809591706 0.0369875883 [36] -0.0227265868 -0.1198253188 0.0089638200 -0.1167117368 -0.0959958819 [41] -0.0603076324 -0.1426208226 -0.2000080654 0.0378367683 -0.1483294156 [46] -0.0781379239 -0.1350680863 -0.1796832921 -0.1639176193 -0.1196469954 [51] -0.1974675566 -0.1243983738 -0.1829161551 -0.1072464723 -0.0561598478 [56] -0.1820458583 -0.1444320163 -0.1382022030 -0.1410421884 -0.1002506193 [61] -0.0682511220 > (mypacf <- c(rpacf$acf)) [1] 0.288319771 0.296037804 0.137289433 0.029329504 -0.024792994 [6] 0.200666746 -0.055333623 0.132647855 0.224451136 0.016622988 [11] 0.078315525 -0.419495106 0.029058675 0.113053206 -0.017903062 [16] 0.064980235 0.046416041 0.035278372 -0.097493839 0.050105273 [21] -0.010745114 -0.203789905 0.118503005 0.011284854 -0.100516800 [26] 0.115810899 -0.089232510 0.014079271 -0.004140597 0.012447459 [31] -0.039211046 -0.008028518 0.026425992 -0.055742651 0.017558645 [36] -0.170790676 -0.005653310 0.026645223 -0.016936338 0.035219198 [41] -0.064222915 -0.038071947 0.025803469 -0.093433402 0.058616009 [46] -0.124106701 -0.012538232 -0.068193267 -0.013570019 0.035091119 [51] -0.060912240 -0.015561192 0.028971703 -0.011123534 0.032032838 [56] -0.037232559 0.001130070 -0.015093570 0.033190474 -0.014277999 > 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/3hwmy1228999073.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/4yqw21228999073.tab") > > system("convert tmp/119461228999073.ps tmp/119461228999073.png") > system("convert tmp/21q0o1228999073.ps tmp/21q0o1228999073.png") > > > proc.time() user system elapsed 1.540 0.537 1.644