R/summary.stratified.data.frame.R

Defines functions summary.stratified.data.frame

Documented in summary.stratified.data.frame

summary.stratified.data.frame <- function(object,
                                          ...){

  df <-
    data.frame(cbind(object$intervals,
                     as.numeric(table(object$stratum.index)),
                     round(as.numeric(table(object$stratum.index))/dim(object$data)[1],3)))

  colnames(df) <- c("  Strata bounds","    n","    n (proportion)")

  sum.str <- list(str.var  = object$stratified.by,
                  str.info = df)

  class(sum.str) <- "summary.stratified.data.frame"

  sum.str

}

Try the nonrandom package in your browser

Any scripts or data that you put into this service are public.

nonrandom documentation built on May 29, 2017, 11:41 p.m.