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(1515,1510,1225,1577,1417,1224,1693,1633,1639,1914,1586,1552,2081,1500,1437,1470,1849,1387,1592,1589,1798,1935,1887,2027,2080,1556,1682,1785,1869,1781,2082,2570,1862,1936,1504,1765,1607,1577,1493,1615,1700,1335,1523,1623,1540,1637,1524,1419,1821,1593,1357,1263,1750,1405,1393,1639,1679,1551,1744,1429,1784) > 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/rcomp/tmp/1xpfn1228482048.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/2im3l1228482048.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.3502155651 0.2782150851 0.3020550269 0.2146823515 [6] 0.0251050358 0.0374046116 0.0526125103 0.1536611859 0.1769254164 [11] 0.0202425692 -0.0245520180 0.1279191129 -0.0300176636 -0.1443385637 [16] 0.0066197275 -0.1767178225 -0.1218415530 -0.2120206396 -0.1684662391 [21] -0.2641365748 -0.1121613804 -0.1887509497 -0.1949442969 -0.0810597132 [26] -0.1015663589 -0.2841673769 -0.1756971136 -0.1934908972 -0.2282758254 [31] -0.1692875314 -0.1395464616 -0.0115433977 -0.0093709657 0.0243635537 [36] -0.0682760862 0.1489053564 0.0701851998 -0.0331283429 0.0525077383 [41] 0.1019830856 -0.0162418797 0.0254495586 -0.0006472208 0.0246199695 [46] 0.0340579613 0.0781951649 -0.0062151618 0.0727185913 0.1140048437 [51] 0.0183707377 0.0518876739 0.0488551536 0.0111337736 0.0305524196 [56] 0.0068583077 -0.0137969457 0.0239187437 -0.0116930719 0.0029772823 [61] -0.0052512612 > (mypacf <- c(rpacf$acf)) [1] 0.3502155651 0.1773115747 0.1880505320 0.0458833516 -0.1569203749 [6] -0.0344836809 0.0283919719 0.2003423450 0.1565844257 -0.1560765511 [11] -0.1989728727 0.0970363637 -0.0082890082 -0.0656592256 0.0750332725 [16] -0.2995286074 -0.0335596506 -0.1292080420 0.0654908962 -0.1190860540 [21] 0.0190034508 -0.0682671614 -0.0732656113 0.0652833105 0.0227406052 [26] -0.2171316632 -0.1118960407 -0.0081915538 -0.0123561305 0.0395238291 [31] -0.0293895053 0.0590946045 -0.0505404995 0.0127442455 0.0091322201 [36] 0.1149366904 0.0211342899 -0.1071613503 -0.0253412850 -0.0516124898 [41] -0.0170420525 -0.0277168905 -0.0672346854 -0.1170929790 -0.0813329771 [46] 0.0387891582 -0.0519679898 -0.0109585150 -0.0576929553 0.0453413411 [51] -0.0381371812 0.0508082897 -0.0478957485 -0.0004432798 -0.0859246706 [56] 0.0210744629 -0.0164236517 -0.0789633404 0.0665273527 -0.0333353778 > 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/3k5nn1228482048.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/4ne751228482048.tab") > > system("convert tmp/1xpfn1228482048.ps tmp/1xpfn1228482048.png") > system("convert tmp/2im3l1228482048.ps tmp/2im3l1228482048.png") > > > proc.time() user system elapsed 0.595 0.312 0.710