##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (x, i = 1, plotit = getOption("plotit", FALSE), ...)
{
cat(paste(rep("-", (as.numeric(options("width")) - 2)), collapse = ""),
"")
cat("Multiple dichotomous variables")
if (!is.null(attr(x, "label")))
cat(":", strwrap(attr(x, "label"), indent = 2, exdent = 2),
sep = "")
cat("")
cat("Summary:
", "total n: ", nrow(x), "", sep = "")
d.sub <- x
flags <- do.call(rbind, lapply(d.sub, function(z) {
tab <- table(z)
data.frame(val = names(tab[i]), abs = tab[i], BinomCI(tab[i],
sum(tab)))
}))
out <- data.frame(do.call(rbind, lapply(d.sub, function(x) cbind(NAs = sum(is.na(x)),
n = length(x) - sum(is.na(x))))), flags)
out[, 5:7] <- apply(out[, 5:7], 2, FormatFix, after = 3)
print(out, quote = FALSE)
cat("")
if (plotit)
PlotDesc(x)
}
Run the code above in your browser using DataLab