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(2220.6,2161.5,1863.6,1955.1,1907.4,1889.4,2246.3,2213,1965,2285.6,1983.8,1872.4,2371.4,2287,2198.2,2330.4,2014.4,2066.1,2355.8,2232.5,2091.7,2376.5,1931.9,2025.7,2404.9,2316.1,2368.1,2282.5,2158.6,2174.8,2594.1,2281.4,2547.9,2606.3,2190.8,2262.3,2423.8,2520.4,2482.9,2215.9,2441.9,2333.8,2670.2,2431,2559.3,2661.4,2404.6,2378.3,2489.2,2941,2700.9,2335.6,2770,2764.2,2784.9,2898.8,2853.4,3022.6,2851.4,2630.8) > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '0.6' > 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/freestat/rcomp/tmp/1t2vh1229084217.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/freestat/rcomp/tmp/2hy3b1229084217.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.1608231113 0.2506632964 0.4309215149 0.0042013273 [6] 0.0191675387 0.2142975981 -0.1797662037 -0.0507539135 0.1010373853 [11] -0.3103806681 -0.1714295480 -0.0336736644 -0.2962483646 -0.1056881083 [16] 0.0630560237 -0.1473092997 0.1990641429 0.1338304229 -0.0355569073 [21] 0.1916256629 0.0811875840 -0.0862575979 0.2387563013 -0.0491663404 [26] 0.0269683908 0.0991311639 -0.0876692489 -0.1771339748 -0.0806148019 [31] -0.2184935584 -0.2287212811 -0.0546222761 -0.2201380784 -0.1282178797 [36] -0.0180314145 -0.1521944900 -0.0915826608 0.0441282486 -0.0503070583 [41] -0.0004800672 0.0655107334 0.0310520586 0.0770161863 0.0578344424 [46] -0.0033767594 -0.0105690018 -0.0018899669 > (mypacf <- c(rpacf$acf)) [1] 0.160823111 0.230767819 0.393380693 -0.152526048 -0.193062901 [6] 0.119393839 -0.141017969 -0.056104133 0.089523896 -0.211662664 [11] -0.184465451 0.012527807 0.024182912 0.015084388 0.108944587 [16] 0.054799930 0.231300439 -0.023520817 -0.075926438 -0.004898254 [21] -0.094988092 -0.107924791 0.158824192 -0.136659143 0.096637350 [26] -0.074176111 0.001027220 -0.112149714 -0.166948093 0.048848557 [31] -0.012828467 -0.040373722 -0.026653493 -0.070150077 -0.032805744 [36] 0.005347197 -0.025801277 0.023744310 0.083561608 -0.172527102 [41] -0.044086334 -0.007199667 0.005123724 -0.028354917 0.001239450 [46] -0.043458148 0.034340509 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/389ma1229084218.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/freestat/rcomp/tmp/49f6n1229084218.tab") > > system("convert tmp/1t2vh1229084217.ps tmp/1t2vh1229084217.png") > system("convert tmp/2hy3b1229084217.ps tmp/2hy3b1229084217.png") > > > proc.time() user system elapsed 0.794 0.408 0.936