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(31.58095238 + ,27.88428571 + ,27.31826087 + ,28.8925 + ,28.04772727 + ,28.725 + ,32.0047619 + ,34.53043478 + ,33.4675 + ,34.09 + ,35.47045455 + ,34.5945 + ,34.32045455 + ,32.777 + ,28.38272727 + ,29.17631579 + ,28.61772727 + ,28.195 + ,29.32590909 + ,29.71869565 + ,26.2865 + ,26.81869565 + ,27.64318182 + ,27.09666667 + ,27.04545455 + ,26.018 + ,25.762 + ,25.94333333 + ,24.97318182 + ,21.7435 + ,18.1626087 + ,16.94818182 + ,16.458 + ,16.44 + ,18.20428571 + ,16.4425 + ,15.70409091 + ,13.941 + ,12.23333333 + ,14.75 + ,14.62190476 + ,15.04285714 + ,15.50130435 + ,16.10047619 + ,15.44136364 + ,15.13695652 + ,15.415 + ,15.68952381 + ,17.57142857 + ,18.419 + ,17.96130435 + ,18.3875 + ,17.62571429 + ,17.94590909 + ,17.78954545 + ,17.72818182 + ,18.99090909 + ,19.83428571 + ,20.22590909 + ,20.23608696 + ,21.11857143 + ,21.2505 + ,21.80333333 + ,21.84333333 + ,22.20909091 + ,22.63545455 + ,23.5352381 + ,23.78173913 + ,23.65409091 + ,23.93428571 + ,24.77318182 + ,26.26428571 + ,27.68772727 + ,29.542 + ,29.31086957 + ,29.255 + ,28.68545455 + ,26.15909091 + ,27.11619048 + ,29.39869565 + ,30.98761905 + ,32.95818182 + ,32.19818182 + ,31.67421053 + ,32.49318182 + ,33.6615 + ,32.43863636 + ,34.37526316 + ,32.36363636 + ,30.72809524 + ,30.31136364 + ,27.26304348 + ,25.0525 + ,22.32681818 + ,18.25727273 + ,18.29789474 + ,16.00227273 + ,14.36285714 + ,14.98263158 + ,16.87909091 + ,16.55954545 + ,13.31 + ,9.607391304 + ,9.341428571 + ,7.888181818 + ,1.714705882 + ,0.811 + ,0.713333333) > par5 = '12' > par4 = '0' > par3 = '0' > 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/freestat/rcomp/tmp/1ar5t1229500902.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/freestat/rcomp/tmp/2vnth1229500902.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.932988157 0.856598097 0.779319809 0.710335544 [6] 0.645454617 0.578185806 0.514646540 0.457400130 0.396717133 [11] 0.321173109 0.240369263 0.162734867 0.085504707 0.007117371 [16] -0.054052975 -0.111946783 -0.166634558 -0.212355980 -0.255798969 [21] -0.294106317 -0.314931742 -0.338441182 -0.354401064 -0.368744690 [26] -0.384582663 -0.393838599 -0.394301646 -0.400191053 -0.409824164 [31] -0.420604450 -0.428030773 -0.421638974 -0.408929654 -0.393332516 [36] -0.375000512 -0.354033221 -0.335424699 -0.317275966 -0.296630477 [41] -0.281520103 -0.262859197 -0.243003853 -0.224578537 -0.202065484 [46] -0.176001150 -0.146408436 -0.116602430 -0.085993736 -0.058744484 [51] -0.027710253 0.005133678 0.034538527 0.063792166 0.093021946 [56] 0.124165546 0.157102651 0.190598970 0.221862951 0.254880409 [61] 0.285119968 > (mypacf <- c(rpacf$acf)) [1] 0.932988157 -0.107067657 -0.043352780 0.022008641 -0.016877675 [6] -0.063035887 -0.007435208 0.006644689 -0.076186028 -0.155897837 [11] -0.075755054 -0.033965124 -0.082406018 -0.087915088 0.073208794 [16] -0.062153339 -0.065331999 0.023201371 -0.027172454 -0.031359828 [21] 0.087417301 -0.066709229 0.008665281 -0.048478357 -0.067300143 [26] 0.004613255 0.010220566 -0.116142425 -0.068151319 -0.079168768 [31] -0.054414177 0.052785977 -0.011650322 -0.022171486 0.017023912 [36] -0.041010614 -0.031915857 0.008929507 -0.011105371 -0.068200452 [41] 0.013703044 -0.064252568 -0.048250782 -0.009981082 -0.020672587 [46] 0.029580689 -0.013644921 -0.029459972 -0.006164702 0.019177227 [51] 0.005071403 0.019376165 0.015406729 -0.015942361 0.031675993 [56] 0.017275028 0.021007281 0.036442272 0.029893071 -0.012478891 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/31i2g1229500902.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/freestat/rcomp/tmp/4gwkr1229500902.tab") > > system("convert tmp/1ar5t1229500902.ps tmp/1ar5t1229500902.png") > system("convert tmp/2vnth1229500902.ps tmp/2vnth1229500902.png") > > > proc.time() user system elapsed 0.838 0.432 0.957