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(105.2,91.5,75.3,60.5,80.4,84.5,93.9,78,92.3,90,72.1,76.9,76,88.7,55.4,46.6,90.9,84.9,89,90.2,72.3,83,71.6,75.4,85.1,81.2,68.7,68.4,93.7,96.6,101.8,93.6,88.9,114.1,82.3,96.4,104,88.2,85.2,87.1,85.5,89.1,105.2,82.9,86.8,112,97.4,88.9,109.4,87.8,90.5,79.3,114.9,118.8,125,96.1,116.7,119.5,104.1,121,127.3,117.7,108,89.4,137.4,142,137.3,122.8,126.1,147.6,115.7,139.2,151.2,123.8,109,112.1,136.4,135.5,138.7,137.5,141.5,143.6,146.5,200.7,196.2) > 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/1tq9w1228837171.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/2v2gm1228837171.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.745101714 0.583457122 0.575582218 0.560272072 [6] 0.542115237 0.494423525 0.507284333 0.465768226 0.381881723 [11] 0.388845389 0.481134725 0.551578532 0.389071727 0.327073261 [16] 0.332571584 0.285748273 0.297836414 0.256547790 0.260342050 [21] 0.184216647 0.096341803 0.120977385 0.180240522 0.198739120 [26] 0.088110436 0.052788872 0.050654460 0.011866403 0.022949908 [31] -0.002970991 -0.021533740 -0.074862105 -0.120372812 -0.107161153 [36] -0.066751666 -0.028742239 -0.106916216 -0.129588211 -0.147719696 [41] -0.169533158 -0.159533010 -0.196476881 -0.206788175 -0.217971791 [46] -0.238476402 -0.224553164 -0.183243693 -0.143105915 > (mypacf <- c(rpacf$acf)) [1] 0.745101714 0.063577041 0.273381846 0.095570599 0.120626080 [6] -0.007441647 0.157250876 -0.076918720 -0.073039552 0.081695991 [11] 0.239889299 0.193486193 -0.344378873 0.036138703 -0.091188869 [16] -0.048546947 0.082149200 -0.126434802 0.047412743 -0.149009746 [21] 0.003665031 -0.046338576 0.071762222 0.012795299 -0.097094076 [26] 0.003424368 -0.062137533 0.032100341 -0.068886581 -0.004619022 [31] -0.080799985 0.048945299 0.034098820 -0.121917381 0.108861109 [36] 0.029414184 -0.039345743 -0.005985419 -0.092082367 0.028348098 [41] -0.094660908 -0.012804539 -0.047097054 0.089514647 0.025008294 [46] -0.025999418 0.035677832 -0.002094461 > 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/337ta1228837171.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/4ip761228837171.tab") > > system("convert tmp/1tq9w1228837171.ps tmp/1tq9w1228837171.png") > system("convert tmp/2v2gm1228837171.ps tmp/2v2gm1228837171.png") > > > proc.time() user system elapsed 0.585 0.332 2.648