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(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 = '0' > 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/freestat/rcomp/tmp/1l5j91242229398.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/2e9nv1242229398.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.00000000 0.96083544 0.91751260 0.87393800 0.83643444 0.80538097 [7] 0.77510591 0.74410164 0.71200353 0.67761939 0.64110837 0.60343407 [13] 0.56388464 0.52121000 0.47727659 0.43576522 0.39439853 0.35352667 [19] 0.31143945 0.26791984 0.22295626 0.17736475 0.13139126 0.08766909 [25] 0.05202908 0.01775200 -0.01723692 -0.05364088 -0.09218908 -0.13256901 [31] -0.16948804 -0.20531904 -0.23679499 -0.26557689 -0.29469157 -0.32250696 [37] -0.34318355 -0.36353894 -0.37780305 -0.39087495 -0.40454295 -0.41545323 [43] -0.42157731 -0.42568157 -0.42388843 -0.42237308 -0.42154355 -0.42146060 [49] -0.42188983 > (mypacf <- c(rpacf$acf)) [1] 0.960835436 -0.074120950 -0.023123520 0.056465981 0.055985292 [6] -0.016282771 -0.022973704 -0.020096367 -0.041083260 -0.045973807 [11] -0.036596258 -0.051155657 -0.071745502 -0.047010079 -0.001493284 [16] -0.039764409 -0.032316575 -0.044545372 -0.044753678 -0.050287438 [21] -0.042742976 -0.044949849 -0.014481716 0.063636904 -0.025140466 [26] -0.042470989 -0.035638280 -0.046700243 -0.060211984 0.002919433 [31] -0.035427970 0.002771465 -0.011642498 -0.044098513 -0.021820068 [36] 0.057117130 -0.037158618 0.052673756 -0.006353130 -0.029147641 [41] 0.011454328 0.036945991 -0.013411180 0.049307181 -0.027192626 [46] -0.019091202 -0.017273635 -0.032242792 > 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/3al4a1242229398.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/4srrb1242229398.tab") > > system("convert tmp/1l5j91242229398.ps tmp/1l5j91242229398.png") > system("convert tmp/2e9nv1242229398.ps tmp/2e9nv1242229398.png") > > > proc.time() user system elapsed 0.789 0.425 0.910