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(2194,2419,2742,2137,2710,2173,2363,2126,1905,2121,1983,1734,2074,2049,2406,2558,2251,2059,2397,1747,1707,2319,1631,1627,1791,2034,1997,2169,2028,2253,2218,1855,2187,1852,1570,1851,1954,1828,2251,2277,2085,2282,2266,1878,2267,2069,1746,2299,2360,2214,2825,2355,2333,3016,2155,2172,2150,2533,2058,2160,2260,2498,2695,2799,2945,2930,2318,2540,2570,2669,2450,2842,3440,2678,2981,2259,2844,2546,2456,2295,2379,2479,2057,2280,2351,2275,2543,2305,2188,2720,2398,2147,1898,2538,2081,2057,2497,2460,2195,2823,2100,2640,2342,2171,2482) > par5 = '12' > par4 = '0' > par3 = '0' > 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: 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/18dw11242294768.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/2n8ie1242294768.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.000000e+00 4.443160e-01 4.641019e-01 4.890420e-01 2.871021e-01 [6] 2.236872e-01 2.304839e-01 1.821556e-01 2.733892e-01 3.501321e-01 [11] 2.767664e-01 3.498193e-01 4.381100e-01 2.520103e-01 2.316260e-01 [16] 2.414308e-01 3.054510e-02 8.078674e-02 -1.083930e-02 -2.915471e-03 [21] 8.168241e-03 1.208720e-01 2.640774e-02 1.511278e-01 1.425174e-01 [26] 6.726907e-02 -8.569903e-05 -4.051769e-02 -1.332894e-01 -1.644282e-01 [31] -1.926503e-01 -2.426442e-01 -6.593210e-02 -1.122740e-01 -9.873871e-02 [36] -7.605525e-02 -1.981416e-02 -1.394620e-01 -1.907526e-01 -2.077175e-01 [41] -2.294240e-01 -3.016115e-01 -2.678652e-01 -2.303788e-01 -2.036514e-01 [46] -2.169552e-01 -9.572243e-02 -1.225989e-01 -9.324233e-02 > (mypacf <- c(rpacf$acf)) [1] 0.444316017 0.332283517 0.285327455 -0.081303390 -0.116334083 [6] 0.015208084 0.074645007 0.232684098 0.253902306 -0.001959656 [11] -0.011547847 0.149966916 -0.079975846 -0.109283200 -0.013060942 [16] -0.186235751 -0.022442342 -0.128373602 0.017966966 -0.084630430 [21] 0.130235037 -0.059282509 0.066860678 -0.014464669 0.025966091 [26] -0.150520188 -0.082692684 -0.028401341 -0.033450701 -0.025912937 [31] -0.100912182 0.157310670 -0.019401459 -0.007071236 -0.141417203 [36] 0.036689626 -0.029293153 -0.107597119 0.019994491 0.018507430 [41] -0.014096710 -0.036002773 0.138298675 -0.107682352 -0.100276948 [46] 0.127130638 0.021536529 0.043052290 > 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/35rio1242294768.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/4mllu1242294768.tab") > > system("convert tmp/18dw11242294768.ps tmp/18dw11242294768.png") > system("convert tmp/2n8ie1242294768.ps tmp/2n8ie1242294768.png") > > > proc.time() user system elapsed 0.581 0.325 0.842