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(1593,1477.9,1733.7,1569.7,1843.7,1950.3,1657.5,1772.1,1568.3,1809.8,1646.7,1808.5,1763.9,1625.5,1538.8,1342.4,1645.1,1619.9,1338.1,1505.5,1529.1,1511.9,1656.7,1694.4,1662.3,1588.7,1483.3,1585.6,1658.9,1584.4,1470.6,1618.7,1407.6,1473.9,1515.3,1485.4,1496.1,1493.5,1298.4,1375.3,1507.9,1455.3,1363.3,1392.8,1348.8,1880.3,1669.2,1543.6,1701.2,1516.5,1466.8,1484.1,1577.2,1684.5,1414.7,1674.5,1598.7,1739.1,1674.6,1671.8,1802,1526.8,1580.9,1634.8,1610.3,1712,1678.8,1708.1,1680.6,2056,1624,2021.4,1861.1,1750.8,1767.5,1710.3,2151.5,2047.9,1915.4,1984.7,1896.5,2170.8,2139.9,2330.5,2121.8,2226.8,1857.9,2155.9,2341.7,2290.2,2006.5,2111.9,1731.3,1762.2,1863.2,1943.5,1975.2) > 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/1mejr1229248691.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/2r1v21229248691.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.715819430 0.696096929 0.632677877 0.606217728 [6] 0.646656063 0.609467781 0.604522546 0.514410606 0.430835055 [11] 0.399650942 0.432532931 0.479034621 0.342692790 0.335281734 [16] 0.239405429 0.231716845 0.234486795 0.230063810 0.194614101 [21] 0.162955230 0.083511089 0.074735332 0.092121931 0.104409128 [26] 0.018650528 0.003741496 -0.083643972 -0.061730017 -0.054747263 [31] -0.106534473 -0.084092662 -0.110263844 -0.172495840 -0.169805305 [36] -0.160952380 -0.116267180 -0.198424915 -0.210257262 -0.255044945 [41] -0.229021282 -0.231274619 -0.249739194 -0.217442345 -0.281108314 [46] -0.335823598 -0.288843506 -0.310706225 -0.252901490 -0.278526547 [51] -0.290523024 -0.291627031 -0.290088590 -0.261076669 -0.245823851 [56] -0.231340111 -0.252557097 -0.250234760 -0.227465375 -0.209771244 [61] -0.139818727 > (mypacf <- c(rpacf$acf)) [1] 0.715819430 0.376740184 0.125341230 0.099037655 0.242368752 [6] 0.065740871 0.051584410 -0.134465384 -0.198047082 -0.087149497 [11] 0.140481890 0.208883550 -0.268742377 -0.047696463 -0.064444065 [16] 0.036268496 0.009258377 0.016624951 -0.136218826 0.094676351 [21] -0.006050071 -0.005077634 -0.032093477 0.041983933 -0.168408198 [26] -0.023445447 -0.082532155 0.044662632 0.047854416 -0.145686207 [31] 0.027464914 0.120107947 0.005405687 -0.094282178 -0.010407228 [36] 0.092297551 -0.098797025 -0.089197457 -0.029580417 -0.017386450 [41] 0.053405996 -0.027751743 -0.047395931 -0.094285300 -0.053976016 [46] 0.110287007 -0.091135366 0.023216185 0.102367460 0.027212987 [51] 0.035594351 -0.047881243 0.031134493 -0.030789854 -0.078106743 [56] -0.023816906 0.059192589 0.022226385 0.057769494 0.007272831 > 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/3clqa1229248691.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/4h5jf1229248691.tab") > > system("convert tmp/1mejr1229248691.ps tmp/1mejr1229248691.png") > system("convert tmp/2r1v21229248691.ps tmp/2r1v21229248691.png") > > > proc.time() user system elapsed 0.609 0.308 0.751