[Distr-commits] r689 - in branches/distr-2.3/pkg/distr: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Nov 24 13:34:55 CET 2010


Author: ruckdeschel
Date: 2010-11-24 13:34:54 +0100 (Wed, 24 Nov 2010)
New Revision: 689

Modified:
   branches/distr-2.3/pkg/distr/R/internals-qqplot.R
   branches/distr-2.3/pkg/distr/R/qqbounds.R
   branches/distr-2.3/pkg/distr/R/qqplot.R
   branches/distr-2.3/pkg/distr/man/internals-qqplot.Rd
   branches/distr-2.3/pkg/distr/man/qqplot.Rd
Log:
distr: + CIs in qqplot may now comprise +-Inf values
       + (basic) qqplot-method gains argument legend.alpha to be able to distinguish nominal and actual confidence level

Modified: branches/distr-2.3/pkg/distr/R/internals-qqplot.R
===================================================================
--- branches/distr-2.3/pkg/distr/R/internals-qqplot.R	2010-11-23 17:16:56 UTC (rev 688)
+++ branches/distr-2.3/pkg/distr/R/internals-qqplot.R	2010-11-24 12:34:54 UTC (rev 689)
@@ -189,7 +189,7 @@
                     n,exact.sCI=(n<100),exact.pCI=(n<100), nosym.pCI = FALSE,
                     with.legend = TRUE, legend.bg = "white",
                     legend.pos = "topleft", legend.cex = 0.8,
-                    legend.pref = "", legend.postf = ""){
+                    legend.pref = "", legend.postf = "", legend.alpha=alpha){
 
    x <- sort(unique(x))
    if("gaps" %in% names(getSlots(class(D))))
@@ -243,13 +243,13 @@
             legpf~nosym0~"pointw."~ex.p~alpha==alpha0~"%- conf. interval"~legpof,
             list(legpf = legend.pref, legpof = legend.postf,
                  ex.p = if(exact.pCI) "exact" else "asympt.",
-                 alpha0 = round(alpha*100,2),
+                 alpha0 = round(legend.alpha*100,2),
                  nosym0 = if(nosym.pCI&&exact.pCI) "shortest asymm." else "symm"))
          expression2 <- substitute(
             legpf~"simult."~ex.s~alpha==alpha0~"%- conf. interval"~legpof,
             list(legpf = legend.pref, legpof = legend.postf,
                  ex.s = if(exact.sCI) "exact" else "asympt.",
-                 alpha0 = round(alpha*100,2)))
+                 alpha0 = round(legend.alpha*100,2)))
 
          lcl <- list()
          if(!qqb$err["sim"]){
@@ -297,6 +297,7 @@
     mcl$nosym.pCI <- mcl$n.CI <- mcl$n.adj <- NULL
     mcl$legend.cex <- mcl$with.legend <- mcl$legend.bg <- NULL
     mcl$legend.pos <- legend.pref <- legend.postf <- NULL
+    mcl$legend.alpha <- NULL
 mcl}
 
 

Modified: branches/distr-2.3/pkg/distr/R/qqbounds.R
===================================================================
--- branches/distr-2.3/pkg/distr/R/qqbounds.R	2010-11-23 17:16:56 UTC (rev 688)
+++ branches/distr-2.3/pkg/distr/R/qqbounds.R	2010-11-24 12:34:54 UTC (rev 689)
@@ -31,6 +31,8 @@
                          getdistrOption("DistrResolution")),lower.tail=FALSE)
       c.crit.l <- q(D)(pmax(p.l-c.crit/sqrt(n),
                        getdistrOption("DistrResolution")))
+      c.crit.l[abs(c.crit.l)==Inf] <- NA
+      c.crit.r[abs(c.crit.r)==Inf] <- NA
       c.crit.l[SIi == 2 | SIi == 3] <- NA
       c.crit.r[SIi == 2 | SIi == 3] <- NA
       c.c[SI.in,1:2] <- cbind(c.crit.l,c.crit.r)
@@ -39,6 +41,8 @@
       c.crit.i <- x.in + c.crit.i/sqrt(n)
       c.crit.i[SIi == 2 | SIi == 3] <- NA
       c.c[SI.in,3:4] <- c.crit.i
+      c.c[SI.in & abs(c.crit.i[,1])==Inf,3] <- NA
+      c.c[SI.in & abs(c.crit.i[,2])==Inf,4] <- NA
    }
    return(list(crit = c.c, err=c(sim=te.s,pw=te.i)))
 }

Modified: branches/distr-2.3/pkg/distr/R/qqplot.R
===================================================================
--- branches/distr-2.3/pkg/distr/R/qqplot.R	2010-11-23 17:16:56 UTC (rev 688)
+++ branches/distr-2.3/pkg/distr/R/qqplot.R	2010-11-24 12:34:54 UTC (rev 689)
@@ -18,7 +18,7 @@
     jit.fac = 0, check.NotInSupport = TRUE,
     col.NotInSupport = "red", with.legend = TRUE, legend.bg = "white",
     legend.pos = "topleft", legend.cex = 0.8, legend.pref = "", 
-    legend.postf = ""){
+    legend.postf = "", legend.alpha = alpha.CI){
 
     mc <- match.call(call = sys.call(sys.parent(1)))
     if(missing(xlab)) mc$xlab <- as.character(deparse(mc$x))
@@ -105,7 +105,7 @@
                   nosym.pCI = nosym.pCI, with.legend = with.legend,
                   legend.bg = legend.bg, legend.pos = legend.pos,
                   legend.cex = legend.cex, legend.pref = legend.pref,
-                  legend.postf = legend.postf)
+                  legend.postf = legend.postf, legend.alpha = legend.alpha)
        }
     }
     return(ret)

Modified: branches/distr-2.3/pkg/distr/man/internals-qqplot.Rd
===================================================================
--- branches/distr-2.3/pkg/distr/man/internals-qqplot.Rd	2010-11-23 17:16:56 UTC (rev 688)
+++ branches/distr-2.3/pkg/distr/man/internals-qqplot.Rd	2010-11-24 12:34:54 UTC (rev 689)
@@ -39,7 +39,8 @@
                     n,exact.sCI=(n<100),exact.pCI=(n<100),
                     nosym.pCI = FALSE, with.legend = TRUE,
                     legend.bg = "white", legend.pos = "topleft",
-                    legend.cex = 0.8, legend.pref = "", legend.postf = "")
+                    legend.cex = 0.8, legend.pref = "", legend.postf = "",
+                    legend.alpha = alpha)
 
 .deleteItemsMCL(mcl)
 .distrExInstalled
@@ -89,6 +90,7 @@
 \item{legend.cex}{magnification factor for the legend}
 \item{legend.pref}{character to be prepended to legend text}
 \item{legend.postf}{character to be appended to legend text}
+\item{legend.alpha}{nominal coverage probability}
 \item{mcl}{arguments in call as a list}
 }
 

Modified: branches/distr-2.3/pkg/distr/man/qqplot.Rd
===================================================================
--- branches/distr-2.3/pkg/distr/man/qqplot.Rd	2010-11-23 17:16:56 UTC (rev 688)
+++ branches/distr-2.3/pkg/distr/man/qqplot.Rd	2010-11-24 12:34:54 UTC (rev 689)
@@ -24,7 +24,7 @@
     jit.fac = 0, check.NotInSupport = TRUE,
     col.NotInSupport = "red", with.legend = TRUE, legend.bg = "white",
     legend.pos = "topleft", legend.cex = 0.8, legend.pref = "", 
-    legend.postf = "")
+    legend.postf = "", legend.alpha = alpha.CI)
 \S4method{qqplot}{ANY,ANY}(x, y,
     plot.it = TRUE, xlab = deparse(substitute(x)),
     ylab = deparse(substitute(y)), ...)
@@ -78,6 +78,7 @@
 \item{legend.cex}{magnification factor for the legend}
 \item{legend.pref}{character to be prepended to legend text}
 \item{legend.postf}{character to be appended to legend text}
+\item{legend.alpha}{nominal coverage probability}
 }
 
 \description{



More information about the Distr-commits mailing list