#' Multiple LM
#'
#' Fit multiple LM fast, only returning the coefficients.
#'
#' @param X a matrix containing predictor values and 1 in first column.
#' @param y a vector (or single-column matrix) containing response values.
#'
#' @return Vector containing the coefficients.
#'
#' @seealso
#' \code{\link{lmxy1}}.
#'
#' @export
lmxy2 <- function(X, y)
{
XtX <- crossprod(X,X)
Xty <- crossprod(X,y)
beta <- c(solve(XtX, Xty))
beta
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.