From wolfgang.lederer at stat.uni-muenchen.de  Thu Apr 21 13:36:22 2005
From: wolfgang.lederer at stat.uni-muenchen.de (wolfgang.lederer@stat.uni-muenchen.de)
Date: Thu Apr 21 13:36:29 2005
Subject: [Rd] printCoefmat(signif.legend =FALSE) (PR#7802)
Message-ID: <20050421113622.AFBCEA1ED@slim.kubism.ku.dk>

printCoefmat(signif.legend =FALSE) does not work properly. The option 
"signif.legend = FALSE" is ignored as shown in the example below.

cmat <- cbind(rnorm(3, 10), sqrt(rchisq(3, 12)))
cmat <- cbind(cmat, cmat[,1]/cmat[,2])
cmat <- cbind(cmat, 2*pnorm(-cmat[,3]))
colnames(cmat) <- c("Estimate", "Std.Err", "Z value", "Pr(>z)")

# Prints the legend, although it should not

printCoefmat(cmat, signif.stars =TRUE, signif.legend = FALSE)
#     Estimate Std.Err Z value   Pr(>z)
#[1,]  10.3567  3.3680  3.0750 0.002105 **
#[2,]   9.1652  4.3609  2.1017 0.035581 *
#[3,]  10.4420  3.6527  2.8587 0.004253 **
#---
#Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

# Does not print the legend, although it should

printCoefmat(cmat, signif.stars = FALSE, signif.legend = TRUE)
#     Estimate Std.Err Z value   Pr(>z)
#[1,]  10.3567  3.3680  3.0750 0.002105
#[2,]   9.1652  4.3609  2.1017 0.035581
#[3,]  10.4420  3.6527  2.8587 0.004253


I think the problem can be easily solved by changing the code lines (3. 
and 4. from the bottom)

if (signif.stars)
        cat("---\nSignif. codes: ", attr(Signif, "legend"), "\n")
to

if (signif.legend)
        cat("---\nSignif. codes: ", attr(Signif, "legend"), "\n")

At least it works for the more sensibel case, that no legend should be 
produced.

Regards

Wolfgang



--please do not edit the information below--

Version:
 platform = i386-pc-mingw32
 arch = i386
 os = mingw32
 system = i386, mingw32
 status =
 major = 2
 minor = 1.0
 year = 2005
 month = 04
 day = 18
 language = R

Windows XP Professional (build 2600) Service Pack 2.0

Search Path:
 .GlobalEnv, package:simex, package:methods, package:stats, 
package:graphics, package:grDevices, package:utils, package:datasets, 
Autoloads, package:base

**************************************************

Wolfgang Lederer
Institut f?r Statistik
Ludwig-Maximilians-Universit?t M?nchen
Ludwigstra?e 33
D-80539 M?nchen
Tel: +49 89 2180 3165
Fax: +49 89 2180 5308


[Rd] printCoefmat(signif.legend =FALSE) (PR#7802)
wolfgang.lederer@stat.uni-muenchen.de