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(2236,2084.9,2409.5,2199.3,2203.5,2254.1,1975.8,1742.2,2520.6,2438.1,2126.3,2267.5,2201.1,2128.5,2596,2458.2,2210.5,2621.2,2231.4,2103.6,2685.8,2539.3,2462.4,2693.3,2307.7,2385.9,2737.6,2653.9,2545.4,2848.8,2359.5,2488.3,2861.1,2717.9,2844,2749,2652.9,2660.2,3187.1,2774.1,3158.2,3244.6,2665.5,2820.8,2983.4,3077.4,3024.8,2731.8,3046.2,2834.8,3292.8,2946.1,3196.9,3284.2,3003,2979,3137.4,3630.2,3270.7,2942.3) > 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/1tmxb1228320065.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/2szp81228320065.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.7066859009 0.6207838874 0.6793093761 0.5729775563 [6] 0.6003320370 0.6647172656 0.4993744135 0.4055604094 0.4643043217 [11] 0.3059895960 0.3524863902 0.4730281609 0.2734782804 0.2258094306 [16] 0.2351013216 0.1466262983 0.1918134679 0.2242089798 0.0863275002 [21] 0.0175344123 0.0171545676 -0.1116116966 -0.0278794937 0.0001761746 [26] -0.1140173380 -0.1547838991 -0.1775561830 -0.2221624004 -0.1910823970 [31] -0.1603912503 -0.2489480204 -0.2663051641 -0.2974921852 -0.3453189594 [36] -0.2926060989 -0.2526278286 -0.3151850212 -0.3496592589 -0.3447363126 [41] -0.3394962557 -0.3116802708 -0.2720180324 -0.2985926354 -0.3029474710 [46] -0.3159465489 -0.3145897674 -0.2942560944 -0.2490036000 > (mypacf <- c(rpacf$acf)) [1] 0.706685901 0.242469293 0.372760811 -0.047696511 0.231685662 [6] 0.205463533 -0.217148682 -0.224797050 0.067335545 -0.280246406 [11] 0.184168626 0.271525240 -0.181048491 -0.040786690 -0.119554096 [16] 0.006183705 0.042483933 -0.122037596 0.030204036 -0.152527721 [21] -0.142892593 -0.060292735 0.119341626 -0.027124284 0.117864691 [26] -0.108134199 0.023727816 -0.039415347 -0.139629228 0.006333725 [31] -0.023087581 -0.042398325 0.004870753 -0.003788679 -0.053508586 [36] 0.129925226 -0.109444834 0.027722597 0.052827555 -0.003717646 [41] -0.036390092 -0.048055195 -0.019979445 0.036355348 -0.079673563 [46] 0.025168682 -0.033459496 -0.072581997 > 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/352bj1228320065.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/4hq101228320065.tab") > > system("convert tmp/1tmxb1228320065.ps tmp/1tmxb1228320065.png") > system("convert tmp/2szp81228320065.ps tmp/2szp81228320065.png") > > > proc.time() user system elapsed 0.565 0.319 0.696