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.7,7.6,8.2,8,8.1,8.3,8.2,8.1,7.7,7.6,7.7,8.2,8.4,8.4,8.6,8.4,8.5,8.7,8.7,8.6,7.4,7.3,7.4,9,9.2,9.2,8.5,8.3,8.3,8.6,8.6,8.5,8.1,8.1,8,8.6,8.7,8.7,8.6,8.4,8.4,8.7,8.7,8.5,8.3,8.3,8.3,8.1,8.2,8.1,8.1,7.9,7.7,8.1,8,7.7,7.8,7.6,7.4,7.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/1lkm81229382659.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/2z5uj1229382659.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.109469210 -0.098179792 -0.549710138 -0.207509915 [6] 0.081369753 0.304399355 0.096890608 -0.137406983 -0.286218705 [11] -0.073053757 0.127511552 0.467070291 0.115028012 -0.061694601 [16] -0.332341803 -0.175349276 0.044828459 0.165494752 0.108059640 [21] -0.141619330 -0.021327053 -0.076073930 0.093658493 0.080029921 [26] 0.066190966 -0.039024599 -0.057421866 -0.089821330 -0.001483984 [31] 0.096764768 0.065978245 -0.068691024 -0.074441899 -0.046554774 [36] 0.010926311 0.078435681 0.038158520 -0.006700328 -0.017967928 [41] -0.025308368 -0.025332133 0.019619439 0.009847900 -0.023837241 [46] -0.030943921 -0.002846412 -0.018274932 0.037826971 0.011318248 [51] -0.026551189 0.023917109 -0.014092584 -0.033798904 0.022373127 [56] -0.012667820 -0.021130305 0.025130321 -0.007035383 0.004114558 > (mypacf <- c(rpacf$acf)) [1] 0.109469210 -0.111499455 -0.538629085 -0.172073382 0.018307638 [6] -0.016465584 -0.138695969 -0.162649577 -0.192786929 -0.093642795 [11] -0.078023260 0.301769127 0.061835543 0.075376470 0.138317757 [16] 0.056243829 0.077260179 -0.010354564 0.030960470 -0.117706118 [21] 0.183116606 -0.018461679 -0.103907058 -0.119443088 -0.032062194 [26] -0.077732770 -0.028044729 -0.034214661 -0.041878064 0.148655989 [31] 0.051783438 0.010521806 -0.080133103 0.081206706 -0.085158310 [36] 0.015821415 0.006774711 -0.046330991 -0.016877317 -0.022590757 [41] -0.017961899 -0.146830181 -0.031172539 -0.081698374 0.021598570 [46] 0.014422455 0.008203788 -0.066550752 0.015415673 -0.037811901 [51] -0.013835965 -0.045939985 -0.118858909 0.124373235 -0.062662077 [56] -0.043241202 -0.010476859 -0.028577899 -0.026432264 > 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/35pqz1229382660.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/44ey71229382660.tab") > > system("convert tmp/1lkm81229382659.ps tmp/1lkm81229382659.png") > system("convert tmp/2z5uj1229382659.ps tmp/2z5uj1229382659.png") > > > proc.time() user system elapsed 0.607 0.329 0.782