R/coef.lmfm.R

Defines functions coef.lmfm

#' @importFrom stats coef

#' @export
coef.lmfm <- function(object, ...)
{
  n.models <- length(object)
  mod.names <- names(object)
  coefs <- lapply(object, coef)
  coef.names <- unique(unlist(lapply(coefs, names)))

  coefmat <- matrix(NA, n.models, length(coef.names))
  dimnames(coefmat) <- list(mod.names, coef.names)
  for(i in 1:n.models)
    coefmat[i, names(coefs[[i]])] <- coefs[[i]]

  coefmat
}

Try the fit.models package in your browser

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

fit.models documentation built on Aug. 2, 2020, 5:06 p.m.