R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(3.42,3.42,3.43,3.47,3.51,3.52,3.52,3.52,3.52,3.52,3.52,3.52,3.52,3.52,3.58,3.6,3.61,3.61,3.61,3.63,3.68,3.69,3.69,3.69,3.69,3.69,3.69,3.69,3.69,3.78,3.79,3.79,3.8,3.8,3.8,3.8,3.81,3.95,3.99,4,4.06,4.16,4.19,4.2,4.2,4.2,4.2,4.2,4.23,4.38,4.43,4.44,4.44,4.44,4.44,4.44,4.45,4.45,4.45,4.45,4.45,4.45,4.45,4.45,4.46,4.46,4.46,4.48,4.58,4.67,4.68,4.68) > par5 = '12' > par4 = '0' > par3 = '1' > 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/rcomp/tmp/1azle1242067218.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/2ekx41242067218.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.326575390 -0.092381679 -0.069179739 -0.007429295 [6] -0.099125240 -0.131685518 -0.081386569 0.184831417 0.066822562 [11] -0.080963828 0.021122138 0.203477979 -0.078954654 -0.180588601 [16] -0.132167843 -0.166606312 -0.078761776 -0.050472309 0.097638457 [21] 0.202149659 -0.035552850 -0.133011013 -0.070257651 -0.147712167 [26] -0.112949322 -0.012158032 0.092517285 0.041831551 0.018005774 [31] -0.026078939 0.064026720 0.035897515 -0.038384134 -0.006082997 [36] 0.053078097 -0.029263363 -0.003763830 0.002643799 0.048766964 [41] 0.015459056 -0.066627115 -0.069282214 -0.052973053 -0.020799560 [46] 0.035972766 0.040958075 0.001924420 0.022865237 > (mypacf <- c(rpacf$acf)) [1] 0.326575390 -0.222794532 0.047668355 -0.020041550 -0.119789134 [6] -0.059115553 -0.048609247 0.232659162 -0.138085959 -0.013893329 [11] 0.079966643 0.146876305 -0.237557341 0.010504621 -0.073459326 [16] -0.247268941 0.099173505 -0.092044109 0.181526348 -0.081230806 [21] -0.083772150 0.004527200 -0.142659009 -0.119146534 0.050755958 [26] 0.023046413 0.004625577 -0.026409537 -0.016318348 -0.049639602 [31] -0.027507415 -0.037224476 0.100164992 -0.043055490 0.053246028 [36] 0.033014246 -0.095787967 -0.031034136 -0.082120477 -0.013039832 [41] -0.064761930 -0.007686696 -0.060720652 0.067411600 -0.037005295 [46] -0.069710211 -0.023582490 0.003442158 > 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/3l2ev1242067218.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/448kt1242067218.tab") > > system("convert tmp/1azle1242067218.ps tmp/1azle1242067218.png") > system("convert tmp/2ekx41242067218.ps tmp/2ekx41242067218.png") > > > proc.time() user system elapsed 0.569 0.314 0.695