R/get_star.R

#' Create the Siginicance Stars
#' @description Based on the coefficient and standard errors and
#' significance levels, return character vector of stars.
#' @param pv vector of p values
#' @param alpha vector of significance levels
#' @param ... not used
#' @return character vector
#' @keywords internal
get_star <- function(pv, alpha, ...)
{
  alpha <- unique(sort(alpha))
  star <- rep('', length(pv))
  for (a in alpha)
  {
    index <- which(pv < a)
    star[index] <- paste0(star[index], "*")
  }
  star
}

Try the outreg package in your browser

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

outreg documentation built on May 2, 2019, 9:33 a.m.