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(102.9,102.9,102.9,102.9,104.2,104.7,104.7,104.7,104.7,104.7,104.7,104.7,104.7,104.7,104.7,104.7,106,107,107,107,107,107,107,107,107,107,107,107,107.6,109.9,109.9,109.9,109.9,109.9,109.9,109.9,109.9,109.9,109.9,109.9,110.6,114.3,114.3,114.3,114.3,114.3,114.3,114.3,114.3,114.3,114.3,114.3,114.3,119.01,119.01,119.01,119.01,119.01,119.01,119.01,119.01,119.01,119.01,119.01,121.27,123.54,123.54,123.54,123.54,123.54,123.54,123.54,123.54,123.54,123.54,123.54,123.54,125.24,125.24,125.24,125.24,125.24,125.24,125.24,125.24,125.24,125.24,125.24,125.24,128.35,128.35,128.35,128.35,128.35,128.35,128.35) > par5 = '12' > par4 = '1' > 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/freestat/rcomp/tmp/1ow8f1229034142.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/2hx9m1229034142.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.893020903 0.831867243 0.770713582 0.709559922 [6] 0.648406261 0.593219096 0.538031930 0.480860770 0.423689610 [11] 0.366518449 0.309347289 0.199168975 0.127742851 0.085610874 [16] 0.043478897 0.001346919 -0.049138151 -0.084110334 -0.119082517 [21] -0.153252660 -0.184242783 -0.215232906 -0.246223030 -0.277385103 [26] -0.283469014 -0.310722041 -0.337975067 -0.365228093 -0.391287821 [31] -0.400641362 -0.409994904 -0.415915149 -0.425015415 -0.434115681 [36] -0.443215946 -0.447688029 -0.421234049 -0.400115336 -0.378996622 [41] -0.357877909 -0.345112288 -0.320294347 -0.295476407 -0.272079626 [46] -0.247697883 -0.223316140 -0.198934397 -0.160025302 > (mypacf <- c(rpacf$acf)) [1] 0.893020903 0.169770809 0.011940028 -0.024508092 -0.033690742 [6] -0.006422597 -0.022693883 -0.042299822 -0.041799825 -0.041414334 [11] -0.041623249 -0.315737470 0.003060972 0.143714094 0.038428404 [16] -0.028593351 -0.109541849 0.019257740 0.009194152 -0.028652439 [21] -0.030597331 -0.031498971 0.023165919 -0.126754879 -0.014074134 [26] -0.085083531 -0.034468512 -0.020816758 -0.110481713 0.024749996 [31] 0.010726586 -0.008412279 -0.058103817 -0.077047308 -0.014796319 [36] -0.065744866 0.188250823 0.036232066 -0.050302037 -0.039572232 [41] -0.166433209 0.057920618 0.030299263 0.015455889 -0.008637347 [46] -0.079987100 -0.029590809 -0.063658421 > 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/390mr1229034142.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/4qn3o1229034142.tab") > > system("convert tmp/1ow8f1229034142.ps tmp/1ow8f1229034142.png") > system("convert tmp/2hx9m1229034142.ps tmp/2hx9m1229034142.png") > > > proc.time() user system elapsed 0.786 0.408 0.877