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(7.6,7.4,7.3,7.1,6.9,6.8,7.5,7.6,7.8,8,8.1,8.2,8.3,8.2,8,7.9,7.6,7.6,8.2,8.3,8.4,8.4,8.4,8.6,8.9,8.8,8.3,7.5,7.2,7.5,8.8,9.3,9.3,8.7,8.2,8.3,8.5,8.6,8.6,8.2,8.1,8,8.6,8.7,8.8,8.5,8.4,8.5,8.7,8.7,8.6,8.5,8.3,8.1,8.2,8.1,8.1,7.9,7.9,7.9,8,8,7.9,8,7.7,7.2,7.5,7.3,7,7,7,7.2,7.3,7.1,6.8,6.6,6.2,6.2,6.8,6.9,6.8,6.7) > par5 = '12' > par4 = '0' > 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/165m91229173481.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/214pr1229173481.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.3569958848 -0.1645753221 -0.4759158065 -0.3850097821 [6] -0.0119240370 0.3113742157 0.1680665182 -0.1050226000 -0.2676077717 [11] -0.1490757606 0.1619274101 0.5415401741 0.1550630776 -0.1064899143 [16] -0.2781825541 -0.1948660865 0.0025973150 0.1879174256 0.0906024422 [21] -0.0719827295 -0.1840214531 -0.0626054105 0.0859812454 0.3204816839 [26] 0.0668218309 -0.0827093031 -0.2084092289 -0.1056634959 0.0376104702 [31] 0.1301861971 0.0844801997 -0.0601936180 -0.1330702287 -0.0820852729 [36] -0.0127335897 0.1906496661 0.0147068745 -0.0537677933 -0.0943128921 [41] 0.0319604668 0.1060176752 0.1257336572 -0.0227349389 -0.1964008635 [46] -0.1865513054 -0.1102172300 0.0356371855 0.2396276057 0.0943466235 [51] -0.0489610740 -0.0864703501 -0.0499055522 0.0004722391 0.0622343655 [56] -0.0101868718 -0.0695540714 -0.0349625582 -0.0545604803 -0.0275585239 [61] 0.1143493220 > (mypacf <- c(rpacf$acf)) [1] 0.356995885 -0.334674306 -0.358821461 -0.169235974 0.033706046 [6] 0.098670173 -0.214886340 -0.172587497 -0.093911166 0.007036288 [11] 0.096131649 0.403256270 -0.284445925 0.169687576 0.160302297 [16] 0.121361491 -0.075166659 -0.017289042 0.058958734 -0.008536401 [21] -0.078940933 0.050109912 -0.103176106 0.057882532 -0.032801397 [26] -0.023561258 -0.088303818 0.048169535 0.055259489 -0.090821990 [31] 0.053294791 -0.030049941 0.063163069 -0.140174410 -0.039699751 [36] 0.033251692 -0.148411721 -0.055082206 0.062413811 0.079625912 [41] 0.030805952 0.066046701 -0.064980526 -0.091186841 0.046203543 [46] -0.122255643 -0.051777234 -0.040236245 0.081325926 -0.120468444 [51] 0.027881376 -0.097889817 -0.084432723 -0.057844209 -0.018629758 [56] 0.093986589 0.003584653 -0.003548813 -0.003845668 0.038809149 > 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/38u251229173481.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/4f54t1229173481.tab") > > system("convert tmp/165m91229173481.ps tmp/165m91229173481.png") > system("convert tmp/214pr1229173481.ps tmp/214pr1229173481.png") > > > proc.time() user system elapsed 0.595 0.331 0.718