#' Differential expression analysis using likelihood
#' ratio test statistic
#'
#' This function tests for differential gene expression
#' using a nested linear model framework.
#'
#' @param exp Expression set.
#' @param species Sample species label (a factor vector).
#'
#' @keywords Humanzee
#'
#' @export
#' @examples
#' fit_lm()
fit_lm <- function(exp,species) {
null <- lm(exp ~ 1)
model <- lm(exp ~ species)
coef <- model$coef[2]
se <- summary(model)$coef[2,2]
t <- summary(model)$coef[2,3]
pval <- lrtest(model,null)$Pr[2]
return(list(coef = coef, se = se,
t = t, pval = pval) )
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.