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(101.5,100.7,110.6,96.8,100.0,104.8,86.8,92.0,100.2,106.6,102.1,93.7,97.6,96.9,105.6,102.8,101.7,104.2,92.7,91.9,106.5,112.3,102.8,96.5,101.0,98.9,105.1,103.0,99.0,104.3,94.6,90.4,108.9,111.4,100.8,102.5,98.2,98.7,113.3,104.6,99.3,111.8,97.3,97.7,115.6,111.9,107.0,107.1,100.6,99.2,108.4,103.0,99.8,115.0,90.8,95.9,114.4,108.2,112.6,109.1,105.0,105.0,118.5,103.7,112.5,116.6,96.6,101.9,116.5,119.3,115.4,108.5,111.5,108.8,121.8,109.6,112.2,119.6,104.1,105.3,115.0,124.1,116.8,107.5,115.6,116.2,116.3,119.0,111.9,118.6,106.9,103.2) > par5 = '12' > par4 = '1' > 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/rcomp/tmp/10alv1229428601.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/2yyxj1229428601.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.0191418610 0.1906295458 0.3865212461 -0.0618368838 [6] 0.1436006288 0.1471551370 -0.2319030796 -0.1135265562 0.0216260978 [11] -0.2533614592 -0.1099039298 -0.1218126514 -0.2281319013 -0.0208323460 [16] 0.0121232604 -0.1197968224 0.0834202984 0.0696617895 -0.1086766111 [21] 0.1981405603 0.1353320492 -0.0980964236 0.3658603121 -0.0922323640 [26] -0.0011221389 0.2133809689 -0.1056113683 -0.0277935911 0.0285458877 [31] -0.2236970407 -0.0289637247 0.0253806663 -0.2322210274 0.0004441544 [36] -0.0409407667 -0.1138077598 0.1023140467 0.0330881943 -0.0670391165 [41] 0.1048022114 0.0633870930 -0.0197826086 0.1182555646 0.0673538521 [46] -0.1375424823 0.0875549154 -0.0688950707 -0.1515086694 0.0739569798 [51] -0.1479319653 -0.0838315567 0.0085251939 -0.0846449479 0.0114947143 [56] -0.0012357100 -0.1129657864 0.0261050793 0.0250217363 -0.0531293130 [61] 0.0169072393 > (mypacf <- c(rpacf$acf)) [1] 0.019141861 0.190332875 0.394348612 -0.100150959 -0.010053013 [6] 0.038953603 -0.239973251 -0.284925535 0.054340217 -0.004912911 [11] -0.068275924 -0.091775240 0.003690056 0.048566317 0.081123998 [16] -0.015588143 0.067778710 0.044261901 -0.196771163 0.005161744 [21] 0.200772713 -0.085364019 0.207563540 -0.142026128 -0.025865760 [26] -0.036265322 0.020754770 -0.011947917 -0.060388216 -0.148070611 [31] 0.061199205 0.043021475 -0.010092009 0.061060827 0.037226614 [36] -0.052299322 0.017463561 0.008971882 0.027825235 -0.050830949 [41] -0.060664203 0.025815981 -0.016530516 0.022716531 -0.030259104 [46] -0.129547760 -0.037336885 -0.103772191 0.053905107 0.052520144 [51] 0.094969465 -0.090878302 0.053543028 0.039470795 -0.085408659 [56] -0.074477686 -0.048953631 -0.049138674 -0.073975883 -0.108017935 > 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/3ed8p1229428602.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/4g1ss1229428602.tab") > > system("convert tmp/10alv1229428601.ps tmp/10alv1229428601.png") > system("convert tmp/2yyxj1229428601.ps tmp/2yyxj1229428601.png") > > > proc.time() user system elapsed 0.579 0.304 0.710