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(1552,2081,1500,1437,1470,1849,1387,1592,1590,1798,1935,1887,2027,2080,1556,1682,1785,1869,1781,2082,2571,1862,1938,1505,1767,1607,1578,1495,1615,1700,1337,1531,1623,1543,1640,1524,1429,1827,1603,1351,1267,1742,1384,1392,1649,1665,1526,1717,1391,1790,1472,1350,1704,1391,1190,1351,1160,1236,1444,1257,1193,1701,1428,1611,1431,1472,1240,1276,1467,1603,2014,2463,2510) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '48' > #'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/11pi21289987658.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/21pi21289987658.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.3613319351 -0.0149632850 0.0466013127 0.0789422435 [6] -0.1627682686 -0.0107931897 -0.0632147444 0.1038997887 0.0963708550 [11] -0.0870227831 -0.0364914816 0.2022180669 -0.1258583147 -0.0756231707 [16] 0.1020342616 -0.0728208845 0.0293332392 -0.0701072899 0.0833261008 [21] -0.1167900856 0.1572392905 -0.1508832045 -0.0777639190 0.1492545219 [26] 0.0029509763 -0.0717042173 0.0868089074 -0.0002179099 -0.0173917545 [31] 0.0420748614 -0.1434317439 0.0939292630 0.0206601570 0.0047439606 [36] -0.1589759821 0.1495860859 0.0222272931 -0.1274141197 0.0474145915 [41] 0.0224129762 -0.0385343242 0.0254811398 -0.0068661068 0.0048924466 [46] -0.0057249816 -0.0077870879 -0.1482304967 0.0976727127 > (mypacf <- c(rpacf$acf)) [1] -0.3613319351 -0.1673769102 -0.0238899716 0.1035970321 -0.1007748517 [6] -0.1224830121 -0.1730649114 0.0191805299 0.2100748116 0.0575480608 [11] -0.0915006981 0.0963674877 -0.0022089272 -0.0413162556 0.0792545660 [16] -0.0579543461 0.0061320650 -0.0920580698 0.0449203092 -0.1138369493 [21] 0.0496467611 -0.0492866196 -0.2088684066 0.0107656392 0.0931564729 [26] 0.0672950471 0.0457917669 -0.0076911122 -0.0370402265 0.0868650020 [31] -0.0623555142 0.0951748245 -0.0086074152 0.0417149529 -0.1144349352 [36] -0.1178308696 0.1009324669 -0.0914849054 0.0050830042 -0.0578786215 [41] -0.0824094175 0.0031622160 0.0804170930 0.0613664753 -0.0850429017 [46] -0.0722867657 -0.1361884801 0.0006956341 > 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/3xggs1289987658.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/4qqfd1289987658.tab") > > try(system("convert tmp/11pi21289987658.ps tmp/11pi21289987658.png",intern=TRUE)) character(0) > try(system("convert tmp/21pi21289987658.ps tmp/21pi21289987658.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.565 0.319 1.227