Nothing
#' Expected values in a contingency table
#'
#' This function calculates expected values for a rxc contingency table.
#' @param M a matrix of observed probabilities
#' @return A matrix of expected values.
#' @author Olivier Gimenez <olivier.gimenez@cefe.cnrs.fr>, Roger Pradel, RĂ©mi Choquet
#' @keywords package
#' @export
expval_table <- function(M) {
nblines = nrow(M)
nbcolumns = ncol(M)
ML = as.matrix(apply(M, 1, sum))
MC = t(as.matrix(apply(M, 2, sum)))
tot = sum(ML)
if (tot != 0) {
RES = repmat(ML, 1, nbcolumns) * repmat(MC, nblines, 1) / tot
} else {
RES = M
}
RES
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.