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(1846.5,2796.3,2895.6,2472.2,2584.4,2630.4,2663.1,3176.2,2856.7,2551.4,3088.7,2628.3,2226.2,3023.6,3077.9,3084.1,2990.3,2949.6,3014.7,3517.7,3121.2,3067.4,3174.6,2676.3,2424,3195.1,3146.6,3506.7,3528.5,3365.1,3153,3843.3,3123.2,3361.1,3481.9,2970.5,2537,3257.6,3301.3,3391.6,2933.6,3283.2,3139.7,3486.4,3202.2,3294.4,3550.3,3279.3,2678.6,3451.4,3977.1,3814.8,3310.5,3971.8,4051.9,4057.6,4391.4,3628.9,4092.2,3822.5) > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '0.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/1gjwl1228835026.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/2s8ke1228835026.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.519173454 0.467869263 0.538071030 0.307473439 [6] 0.179149667 0.229024417 -0.008684385 -0.020604138 -0.029559870 [11] -0.224968625 -0.309090021 -0.225078440 -0.301966961 -0.274126411 [16] -0.253558548 -0.270458159 -0.118698595 -0.112915369 -0.139750703 [21] -0.075397483 -0.061061492 -0.113385095 -0.041841647 -0.196497330 [26] -0.135233659 -0.043440506 -0.093129624 -0.163365169 -0.038715120 [31] -0.106767981 -0.099094896 -0.014981301 -0.054203425 -0.023021562 [36] 0.119489997 0.015124390 0.054486179 0.138082593 0.096406726 [41] 0.067950400 0.117728090 0.045856699 0.044287941 0.080884931 [46] -0.002800571 0.013622589 0.017715277 > (mypacf <- c(rpacf$acf)) [1] 0.519173454 0.271511759 0.325380229 -0.143607745 -0.190456341 [6] 0.037013336 -0.210496329 0.027668015 -0.035772652 -0.176541122 [11] -0.213529130 0.018678895 0.084871212 0.088448897 -0.080907806 [16] -0.088104299 0.187108965 -0.004905845 -0.031693712 -0.146061645 [21] -0.124275687 -0.131776473 0.010446373 -0.258910848 -0.008533541 [26] 0.061826490 0.119004815 -0.050635592 -0.021906907 -0.033222242 [31] -0.031041821 0.082950356 -0.048321206 -0.082023264 -0.094340068 [36] -0.103259676 0.044855749 0.028362789 -0.021052038 -0.150536736 [41] 0.037947077 0.046335679 0.019127224 -0.065230186 -0.073898500 [46] 0.003214622 -0.034118419 > 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/3i3dv1228835026.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/44akp1228835026.tab") > > system("convert tmp/1gjwl1228835026.ps tmp/1gjwl1228835026.png") > system("convert tmp/2s8ke1228835026.ps tmp/2s8ke1228835026.png") > > > proc.time() user system elapsed 0.605 0.330 0.710