#' Marginal r-squared for lm objects
#'
#' This method uses r.squared from \code{\link{summary}} as the marginal.
#' Contrary to other \code{\link{r.squared}} methods,
#' this one doesn't call \code{\link{.rsquared.glmm}}
#'
#' @param mdl an lm object (usually fit using \code{\link{lm}},
#' @return a dataframe with with "Class" = "lm", "Family" = "gaussian",
#' "Marginal" = unadjusted r-squared, "Conditional" = NA, and "AIC" columns
#' @export
#' @examples
#'
r.squared.lm <- function(mdl){
data.frame(Class=class(mdl), Family="gaussian", Link="identity",
Marginal=summary(mdl)$r.squared,
Conditional=NA, AIC=AIC(mdl))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.