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(83.1,89.6,105.7,110.7,110.4,109,106,100.9,114.3,101.2,109.2,111.6,91.7,93.7,105.7,109.5,105.3,102.8,100.6,97.6,110.3,107.2,107.2,108.1,97.1,92.2,112.2,111.6,115.7,111.3,104.2,103.2,112.7,106.4,102.6,110.6,95.2,89,112.5,116.8,107.2,113.6,101.8,102.6,122.7,110.3,110.5,121.6,100.3,100.7,123.4,127.1,124.1,131.2,111.6,114.2,130.1,125.9,119,133.8,107.5,113.5,134.4,126.8,135.6,139.9,129.8,131,153.1,134.1,144.1,155.9,123.3,128.1,144.3,153,149.9,150.9,141,138.9,157.4,142.9,151.7,161,138.5,135.9,151.5,164,159.1,157,142.1,144.8,152.1,154.6,148.7,157.7,146.7) > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '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/1neww1229357796.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/2epo11229357796.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.565004303 0.129279629 0.063471549 -0.082607159 [6] 0.069360978 -0.058273170 0.034070066 -0.164681934 0.280056133 [11] -0.247139673 0.132476248 -0.154843842 0.034094027 0.045885669 [16] -0.022297691 0.020563131 -0.128477259 0.343835684 -0.326640853 [21] 0.153273223 -0.016887240 -0.104505697 0.277088226 -0.241035774 [26] 0.050414537 0.058746864 0.026856408 -0.200963366 0.279109100 [31] -0.279311204 0.131210304 0.074409611 -0.124959288 0.038386552 [36] -0.088368761 0.079488988 -0.072627860 0.073963126 -0.139700122 [41] 0.193289039 -0.091644660 -0.008705498 -0.004071492 0.061394618 [46] -0.089479330 0.048726724 0.130990121 -0.234282762 0.200985628 [51] -0.062834735 -0.083567819 0.109644017 -0.133556506 0.069456092 [56] 0.006674705 -0.007941043 -0.047916316 0.097572550 -0.087442779 [61] 0.059130831 > (mypacf <- c(rpacf$acf)) [1] -5.650043e-01 -2.790226e-01 -1.199578e-03 -1.930258e-03 4.250148e-02 [6] -1.849438e-02 -5.641432e-03 -2.508015e-01 1.027559e-01 -2.352395e-02 [11] 3.692819e-02 -2.241329e-01 -2.047317e-01 -1.204187e-01 5.938802e-02 [16] 6.589939e-02 -1.170530e-01 2.117639e-01 8.902066e-05 -9.478036e-02 [21] -1.783443e-02 -1.086589e-01 2.547551e-01 2.300031e-02 -1.441228e-01 [26] 3.019070e-02 7.029897e-02 -1.426965e-01 1.491186e-01 -9.742834e-03 [31] 3.789138e-02 -5.603131e-02 2.484457e-02 -3.196071e-02 -8.922164e-02 [36] -2.653817e-01 -6.244862e-03 1.288974e-02 -1.075019e-01 1.004744e-01 [41] -1.085322e-01 -6.351056e-05 -8.934259e-02 -1.791350e-02 -3.633150e-02 [46] -3.967544e-02 3.146769e-02 -5.746848e-04 -1.353851e-01 -1.092531e-02 [51] -2.257737e-02 3.371896e-03 -1.927812e-02 -3.470420e-02 -1.291998e-01 [56] -1.744009e-02 9.796899e-02 -3.157168e-02 1.027131e-01 -3.547873e-03 > 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/33exy1229357796.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/4s3i61229357796.tab") > > system("convert tmp/1neww1229357796.ps tmp/1neww1229357796.png") > system("convert tmp/2epo11229357796.ps tmp/2epo11229357796.png") > > > proc.time() user system elapsed 0.598 0.325 0.782