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(5.1,4.9,5.2,5.1,4.6,3.7,3.9,3.1,2.8,2.6,2.2,1.8,1.3,1.2,1.4,1.3,1.3,1.9,1.9,2.1,2.0,1.9,1.9,1.9,1.8,1.7,1.6,1.7,1.9,1.7,1.3,2.0,2.0,2.3,2.0,1.7,2.3,2.4,2.4,2.3,2.1,2.1,2.5,2.0,1.8,1.7,1.9,2.1,1.4,1.6,1.7,1.6,1.9,1.6,1.1,1.3,1.6,1.6,1.7,1.6,1.7,1.6,1.5,1.6,1.1,1.5,1.4,1.3,0.9,1.2,0.9,1.1,1.3,1.3,1.4,1.2,1.7,2.0,3.0,3.1,3.2,2.7,2.8,3.0,2.8,3.1,3.1,3.2,3.1,2.7,2.2,2.2,2.1,2.3,2.5,2.3,2.6) > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '-0.5' > 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/1p13d1228821386.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/23eik1228821386.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.208542830 0.038481804 -0.033677891 0.030051878 [6] 0.063366316 0.043971276 -0.060095739 -0.145839617 0.071729348 [11] -0.059585285 0.111685110 -0.381994033 0.075194898 0.170998483 [16] -0.096135841 0.103465160 -0.118493196 -0.038199856 0.094906400 [21] 0.107027147 -0.096324959 0.081468569 -0.082167036 0.004221093 [26] 0.058408744 -0.186378283 0.120742524 -0.083188202 0.036768718 [31] -0.021351406 -0.087288787 -0.006204001 0.014037650 -0.022303837 [36] -0.029099065 0.095051910 -0.167211831 0.187348054 -0.081323851 [41] 0.032732507 0.116098296 0.009598850 0.012685500 -0.020656204 [46] 0.007212032 0.030666649 0.001107605 -0.048633893 0.027815891 [51] -0.034450149 -0.050364726 0.084640170 -0.105944282 0.016346770 [56] 0.090502575 0.009155863 0.046177847 -0.010308951 0.036237247 [61] 0.045525148 > (mypacf <- c(rpacf$acf)) [1] -0.208542830 -0.005236023 -0.027917572 0.018406291 0.077508618 [6] 0.075439368 -0.037981774 -0.175481995 0.003560171 -0.052490779 [11] 0.085321633 -0.353336126 -0.053010057 0.247871910 -0.063104530 [16] 0.057457304 -0.049049756 -0.054356327 0.068613953 -0.007258143 [21] -0.030626153 0.100690022 -0.023836257 -0.169988654 -0.004177082 [26] -0.032140505 0.043539838 -0.016085555 -0.033533849 -0.052009311 [31] -0.034828058 0.021859781 -0.084547187 -0.003434896 -0.044059274 [36] -0.012045523 -0.068538989 0.061394557 0.015771255 0.038126602 [41] 0.096240966 0.039199485 -0.038294910 -0.007880934 -0.012416476 [46] 0.060273986 -0.066386728 0.003443997 -0.032460205 0.061970131 [51] -0.049954829 0.001788770 0.086797726 -0.036619484 0.062285976 [56] 0.034477900 0.055754511 0.051176369 0.029785645 0.007748496 > 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/3i4b21228821386.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/4vwto1228821386.tab") > > system("convert tmp/1p13d1228821386.ps tmp/1p13d1228821386.png") > system("convert tmp/23eik1228821386.ps tmp/23eik1228821386.png") > > > proc.time() user system elapsed 0.593 0.312 0.895