R version 2.7.0 (2008-04-22) 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(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,2259,2498,2695,2799,2945,2930,2318,2540,2570,2669,2450,2842) > 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/1byor1229268505.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/2ju1w1229268505.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.5113555224 0.4317440758 0.5229301784 0.2672035319 [6] 0.1554249512 0.2772434785 0.1416390239 0.1636161966 0.2607348722 [11] 0.1814146108 0.3049283222 0.3682684100 0.1389705793 0.2319737189 [16] 0.1846814504 -0.0477635797 -0.0032325352 0.0405453768 -0.1497801941 [21] -0.0266450643 0.0677644588 -0.0947936648 0.0378095018 -0.0022662150 [26] -0.1536401876 -0.1104373814 -0.1694720167 -0.3069165593 -0.2258814556 [31] -0.2782992652 -0.3159791254 -0.1158018886 -0.1863323729 -0.2151867662 [36] -0.0908252662 -0.1127140689 -0.1869150990 -0.1477398470 -0.1299631834 [41] -0.2344743024 -0.2173375937 -0.1848578980 -0.1886967926 -0.1740772369 [46] -0.2110889378 -0.1256753174 -0.0895316735 -0.0947272556 -0.0681981409 [51] -0.0114417273 -0.0668331719 -0.0635492113 0.0173698261 0.0054853765 [56] 0.0081597555 0.0159191681 0.0002414608 -0.0207397998 -0.0136090516 > (mypacf <- c(rpacf$acf)) [1] 0.511355522 0.230543027 0.336302593 -0.181212169 -0.138706046 [6] 0.151915002 0.003722492 0.138429589 0.074892445 -0.008612861 [11] 0.227790767 0.097987072 -0.250147426 0.014425014 -0.095684080 [16] -0.108524722 -0.043597665 0.019896297 -0.079655036 0.053552347 [21] 0.083487210 -0.149841741 0.008981033 -0.154544028 -0.081626385 [26] -0.090374712 -0.033992212 -0.031319619 -0.026615909 -0.055018549 [31] 0.048402750 0.114270595 -0.093326925 -0.024487686 -0.108400719 [36] 0.182772052 0.054098752 -0.106273036 0.138190808 -0.027879944 [41] -0.086618639 0.059463059 -0.064019940 -0.138004523 -0.063472275 [46] 0.053060688 0.071408254 0.090526225 0.004861109 -0.049352090 [51] -0.014436472 0.023074155 0.028767147 -0.005582232 0.003285800 [56] 0.008798588 -0.082452102 -0.047385785 -0.020365434 > 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/345r61229268505.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/43iwj1229268505.tab") > > system("convert tmp/1byor1229268505.ps tmp/1byor1229268505.png") > system("convert tmp/2ju1w1229268505.ps tmp/2ju1w1229268505.png") > > > proc.time() user system elapsed 1.539 0.551 1.644