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(1,-1,3,4,3,2,1,4,3,5,6,6,6,6,6,5,6,5,6,5,7,4,5,6,6,5,3,2,3,3,2,0,4,4,5,6,6,5,5,3,5,5,5,3,6,6,4,6,5,4,5,5,4,3,2,3,2,-1,0,-2,1,-2,-2,-2,-6,-4,-2,0,-5,-4,-5,-1) > 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/1yzul1242327123.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/299ov1242327123.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.830563145 0.741727383 0.664048270 0.635549484 [6] 0.593844869 0.514571949 0.430517608 0.324377656 0.266734973 [11] 0.201806315 0.162606254 0.109061931 0.032976624 -0.034001214 [16] -0.061133880 -0.084623558 -0.146819976 -0.149817851 -0.177861263 [21] -0.153992107 -0.137636612 -0.112401336 -0.130881906 -0.114298725 [26] -0.056959624 -0.046751670 -0.040642077 -0.054796600 -0.061665149 [31] -0.028005464 -0.009145416 -0.034911961 -0.037909836 -0.059122647 [36] -0.061437462 -0.072404372 -0.038289314 -0.039238009 -0.089139344 [41] -0.122191864 -0.173914693 -0.178278689 -0.215657256 -0.267607772 [46] -0.300887978 -0.320734669 -0.303696114 -0.296903461 > (mypacf <- c(rpacf$acf)) [1] 8.305631e-01 1.673054e-01 4.016107e-02 1.458573e-01 2.142471e-02 [6] -1.263171e-01 -9.344236e-02 -1.703604e-01 -3.694716e-05 -4.680358e-02 [11] 3.873918e-02 2.911776e-03 -9.447376e-02 -6.179634e-02 5.809935e-02 [16] -2.455252e-02 -1.419674e-01 1.339947e-01 -2.196417e-02 1.098724e-01 [21] 7.261765e-02 4.836828e-02 -1.245606e-01 4.782013e-02 1.175841e-01 [26] -1.062943e-01 -1.056403e-01 -1.938765e-02 -5.513336e-02 8.824963e-02 [31] -1.521846e-02 -1.391012e-01 5.873088e-02 -7.700828e-02 4.202365e-02 [36] -7.172577e-02 1.353981e-01 2.495065e-02 -1.011649e-01 -9.600546e-02 [41] -1.381332e-01 -2.102178e-02 -1.229199e-01 -8.693006e-02 3.891638e-02 [46] -3.898882e-02 1.438419e-01 1.100074e-01 > 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/3gqvd1242327124.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/46g7g1242327124.tab") > > system("convert tmp/1yzul1242327123.ps tmp/1yzul1242327123.png") > system("convert tmp/299ov1242327123.ps tmp/299ov1242327123.png") > > > proc.time() user system elapsed 0.524 0.347 0.687