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(462,455,461,461,463,462,456,455,456,472,472,471,465,459,465,468,467,463,460,462,461,476,476,471,453,443,442,444,438,427,424,416,406,431,434,418,412,404,409,412,406,398,397,385,390,413,413,401,397,397,409,419,424,428,430,424,433,456,459,446) > par7 = '0.95' > par6 = 'White Noise' > 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: > 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 (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > 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/1cben1259922892.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/25bk71259922892.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.190996104 -0.306561704 -0.202607364 -0.086512681 [6] 0.192710326 0.364930780 0.196837538 -0.141922819 -0.311362143 [11] -0.313159378 0.202242511 0.642852714 0.012855791 -0.311445157 [16] -0.222989051 -0.143820180 0.076365422 0.213840132 0.139288622 [21] -0.217270744 -0.315455505 -0.221885750 0.152429910 0.382795258 [26] -0.044949173 -0.279669821 -0.169691032 -0.132514070 0.033246653 [31] 0.142998656 0.111075518 -0.185608800 -0.198211271 -0.049865485 [36] 0.126016459 0.212866777 0.027581726 -0.113004621 -0.084291882 [41] -0.032103178 0.046787698 0.114123484 0.069076045 -0.080084259 [46] -0.074499990 -0.001706720 0.052636447 0.103274231 0.020876672 [51] -0.064439837 -0.038785044 -0.004622135 0.016120189 0.025834150 [56] 0.011984359 -0.030111209 -0.021977431 0.018484264 > (mypacf <- c(rpacf$acf)) [1] 0.1909961045 -0.3560289792 -0.0656164483 -0.1553822412 0.1879246383 [6] 0.2472094974 0.2149515362 0.0018815959 -0.1317428513 -0.3598440164 [11] 0.1193309037 0.4427605007 -0.1997396918 -0.0073137681 -0.0709702437 [16] -0.0495229922 -0.1428488315 -0.2012028348 0.0140669806 -0.1160165179 [21] 0.1191879423 0.0157732986 -0.0488791296 -0.0348002722 -0.0282900392 [26] -0.1303035933 -0.0026760057 -0.1211740419 0.0095827316 -0.1144885352 [31] 0.0401564437 -0.0008723851 0.0813857674 0.1075171400 -0.0646150389 [36] -0.1155197091 0.1175645055 -0.0158682547 -0.0206973149 0.0106194420 [41] -0.0170115668 0.0153612143 -0.1187936118 0.0794376385 -0.0774012094 [46] -0.1025530807 0.0415986836 -0.0736121112 -0.0342424446 -0.0487789191 [51] 0.0228367946 -0.0188571691 0.0089109380 -0.0326858116 0.0084245885 [56] -0.1179478981 0.0519966033 -0.0312415438 > 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/30czh1259922892.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/4qlso1259922892.tab") > > system("convert tmp/1cben1259922892.ps tmp/1cben1259922892.png") > system("convert tmp/25bk71259922892.ps tmp/25bk71259922892.png") > > > proc.time() user system elapsed 0.582 0.325 0.909