R/kkk.R

Defines functions kkk

Documented in kkk

#' @title Sequence of combinatorial coefficients
#' @description Compute the sequence of binomial coefficients \eqn{{m-1}\choose{r-1}}, for \eqn{r= 1, \dots, m}, 
#' and then returns a vector of the same length as ordinal, whose i-th component is the corresponding binomial 
#' coefficient \eqn{{m-1}\choose{r_i-1}}
#' @aliases kkk
#' @keywords internal
#' @usage kkk(m, ordinal)
#' @param m Number of ordinal categories
#' @param Vector of ordinal responses


kkk <-
function(m,ordinal){
  serie<-1:m
  vett<-choose(m-1,serie-1)
  return(vett[ordinal])
}

Try the CUB package in your browser

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

CUB documentation built on March 31, 2020, 5:14 p.m.