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(2072.65,2020.13,2032.76,2050.31,2128.98,2122.14,2122.89,2091.95,2002.97,1923.21,1834.44,1819.15,1792.00,1822.40,1900.70,1903.00,1958.80,1820.50,1719.80,1661.10,1664.40,1703.40,1774.90,1795.00,1816.30,1867.40,1900.00,1961.10,2065.70,2073.50,2080.80,2118.00,2099.00,2085.20,1937.70,1749.50,1750.30,1675.60,1697.50,1699.80,1655.90,1636.00,1614.20,1602.30,1548.70,1556.10,1526.90,1509.20,1566.30,1596.00,1654.50,1664.20,1687.70,1691.00,1664.60,1697.50,1685.10,1643.00,1559.60,1560.20,1590.16,1604.93,1661.80,1670.73,1692.40,1688.17,1658.04,1613.46,1595.11,1558.83,1526.65,1475.19) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '2' > par2 = '-1.7' > 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: > 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/1y6g01262254494.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/235kz1262254494.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.3524078581 0.0988162613 -0.0418853425 -0.3026268083 [6] 0.1567534133 -0.1468969544 0.1622193081 -0.1674548896 0.1379209244 [11] -0.0295353089 -0.0235823005 0.2530972277 -0.3381763472 0.1696060032 [16] -0.1716487072 -0.0299778651 0.2536390397 -0.0394455799 -0.0949811678 [21] 0.0533103934 -0.1586051976 0.0182723578 0.1334645904 0.0105514593 [26] -0.0051363635 -0.0143027007 0.0557087128 -0.0661390947 0.1008179827 [31] -0.1018210023 -0.1479411604 0.1635466622 -0.2191152009 0.2314185268 [36] -0.0444511433 0.0001343547 0.0572460525 -0.1113642733 0.1189235588 [41] -0.0439282540 0.1018376945 -0.0907393235 -0.0276489258 0.0058884059 [46] -0.1062662188 0.1415969956 -0.1028447643 0.1121043145 0.0155134866 [51] -0.0215075735 -0.0094515886 -0.0354446016 0.0039449671 -0.0319517241 [56] -0.0023696569 0.0053428122 0.0169151626 0.0237826839 -0.0082807827 [61] 0.0051558782 > (mypacf <- c(rpacf$acf)) [1] -0.3524078581 -0.0289732645 -0.0185849159 -0.3667910278 -0.0944624407 [6] -0.1369050488 0.0203255720 -0.2716695560 -0.0114869806 -0.0564180343 [11] -0.0363998881 0.1622891329 -0.1721094719 -0.0561570275 -0.1038612745 [16] -0.1002943100 0.1199061568 0.1621849247 -0.2919662359 0.0506560518 [21] -0.1744485198 -0.0476379994 0.0164111638 0.0532514301 0.0019931634 [26] -0.0667679902 0.1417283243 0.0382568054 -0.0100284637 0.0069416659 [31] -0.1073923008 0.0355123021 -0.0231142806 -0.1465649054 -0.0880011956 [36] 0.0177587543 -0.0441340105 0.0006782582 0.0505735307 0.0607145856 [41] 0.0250082561 0.1190428494 0.0627485381 -0.0946538828 0.0242571461 [46] -0.0416437585 -0.0649911153 0.1432296735 0.0365302403 -0.0311553716 [51] -0.0524683524 -0.0704556232 0.0379090360 0.0575665189 -0.0238626769 [56] -0.0113180890 0.0114603069 0.0668356722 -0.0873361847 0.0025614686 > 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/3sj6w1262254494.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/4q9z51262254494.tab") > > try(system("convert tmp/1y6g01262254494.ps tmp/1y6g01262254494.png",intern=TRUE)) character(0) > try(system("convert tmp/235kz1262254494.ps tmp/235kz1262254494.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.595 0.327 1.220