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(90.7,94.3,104.6,111.1,110,107.2,99,99,91,96.2,96.9,96.2,100.1,99,115.4,106.9,107.1,99.3,99.2,108.3,105.6,99.5,107.4,93.1,88.1,110.7,113.1,99.6,93.6,98.6,99.6,114.3,107.8,101.2,112.5,100.5,93.9,116.2,112,106.4,95.7,96,95.8,103,102.2,98.4,111.4,86.6,91.3,107.9,101.8,104.4,93.4,100.1,98.5,112.9,101.4,107.1,110.8,90.3,95.5,111.4,113,107.5,95.9,106.3,105.2,117.2,106.9,108.2,113,97.2,99.9,108.1,118.1,109.1,93.3,112.1,111.8,112.5,116.3,110.3,117.1,103.4,96.2) > 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/17tcp1229684238.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/24q771229684238.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.0000000000 0.2305454832 -0.1206443767 -0.0421680650 -0.0118603278 [6] 0.1565070346 0.1281982854 0.1293440149 0.0079005709 -0.0785087330 [11] -0.2004744368 0.1124112132 0.5376898662 0.0006520649 -0.2436765674 [16] -0.0859917150 -0.0000810245 0.1339461664 0.0668270411 0.0451321180 [21] -0.0138559905 -0.1230960062 -0.2149374473 0.0886750302 0.3040194066 [26] -0.1079249697 -0.2249580380 -0.1207890556 -0.0224713115 0.0384775866 [31] 0.0059005322 -0.0032280544 -0.0158476315 -0.1268651622 -0.1465080938 [36] 0.0874047641 0.2368809834 -0.0603294481 -0.2026065859 -0.0478085905 [41] 0.0453260653 0.1085018162 0.0758966883 0.0923267557 0.0037894778 [46] -0.0888647613 -0.0619094416 0.0740195703 0.1685289090 -0.0239212079 [51] -0.1263137427 0.0015459222 0.0380600741 0.0126287474 -0.0437002910 [56] -0.0372067599 -0.0568863252 -0.1185066039 -0.0466273433 0.0026422271 [61] 0.0299205996 > (mypacf <- c(rpacf$acf)) [1] 0.230545483 -0.183551587 0.036142202 -0.034737138 0.180723967 [6] 0.036570011 0.153442623 -0.047542990 -0.018800367 -0.237637174 [11] 0.237396530 0.420475917 -0.290272875 -0.148857596 0.078670452 [16] 0.049974701 0.003947257 -0.053079041 0.008797615 -0.006604663 [21] -0.031828994 -0.058645806 0.033777680 -0.069503852 -0.057342544 [26] 0.036401621 -0.074832320 -0.049617212 -0.064664283 0.064621903 [31] -0.019002082 -0.003415529 -0.027846267 0.076162360 -0.067509438 [36] 0.099500654 0.014289134 -0.111726350 0.060424691 0.074151321 [41] 0.087327660 0.013079668 0.088060236 -0.060192767 0.048557777 [46] 0.015061691 -0.061980417 -0.066913074 0.035651388 0.071835176 [51] -0.018411068 -0.092777327 -0.095926477 -0.108428909 -0.077103798 [56] 0.011740781 -0.070698539 -0.043934369 -0.069586967 -0.071164099 > 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/3uf7n1229684238.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/4hcip1229684238.tab") > > system("convert tmp/17tcp1229684238.ps tmp/17tcp1229684238.png") > system("convert tmp/24q771229684238.ps tmp/24q771229684238.png") > > > proc.time() user system elapsed 0.820 0.419 0.892