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(10.812,10.738,10.171,9.721,9.897,9.828,9.924,10.371,10.846,10.413,10.709,10.662,10.57,10.297,10.635,10.872,10.296,10.383,10.431,10.574,10.653,10.805,10.872,10.625,10.407,10.463,10.556,10.646,10.702,11.353,11.346,11.451,11.964,12.574,13.031,13.812,14.544,14.931,14.886,16.005,17.064,15.168,16.05,15.839,15.137,14.954,15.648,15.305,15.579,16.348,15.928,16.171,15.937,15.713,15.594,15.683,16.438,17.032,17.696,17.745,19.394,20.148,20.108,18.584,18.441,18.391,19.178,18.079,18.483,19.644,19.195,19.65,20.83) > 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/1qtnv1242324424.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/2mp0o1242324424.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.95181632 0.91250343 0.87582351 0.82687884 0.78401288 [7] 0.74961315 0.70671295 0.67140276 0.63957835 0.60332531 0.55483667 [13] 0.50109561 0.45078169 0.41091737 0.37099274 0.33750556 0.30820320 [19] 0.28562934 0.26148890 0.23895987 0.21078631 0.17853322 0.14307134 [25] 0.10097939 0.06388379 0.02793800 -0.01530708 -0.05235069 -0.08788927 [31] -0.13121873 -0.17555527 -0.20950610 -0.26127001 -0.30221798 -0.33133670 [37] -0.35889398 -0.38189334 -0.39691471 -0.40665624 -0.41181583 -0.40932381 [43] -0.41103013 -0.40954355 -0.40991907 -0.40656765 -0.40285342 -0.39564020 [49] -0.38950584 > (mypacf <- c(rpacf$acf)) [1] 0.9518163245 0.0696375717 0.0159033295 -0.1448568750 0.0169179276 [6] 0.0707977537 -0.0786532341 0.0360795076 0.0071523836 -0.0342717692 [11] -0.1777556415 -0.1301778849 0.0124855328 0.1193950626 -0.0036255930 [16] 0.0133754131 0.0101473650 0.0685528750 -0.0443294383 -0.0209196947 [21] -0.0410388793 -0.0330214230 -0.0798547910 -0.1637786575 -0.0012388201 [26] -0.0144837316 -0.1111865990 -0.0455451269 -0.0160194643 -0.0683949458 [31] -0.0852506345 0.0717018636 -0.1513432985 0.0561989908 0.0581899394 [36] 0.0328407596 -0.0067516837 -0.0036055625 0.0716026588 0.0204385850 [41] 0.0712377409 -0.0698447316 0.0335932957 -0.0546316706 -0.0002953047 [46] -0.0827218983 0.0471308394 -0.0175859937 > 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/38c911242324424.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/4m55z1242324424.tab") > > system("convert tmp/1qtnv1242324424.ps tmp/1qtnv1242324424.png") > system("convert tmp/2mp0o1242324424.ps tmp/2mp0o1242324424.png") > > > proc.time() user system elapsed 0.821 0.433 0.943