#' @export
featrank_glm <- function(Y, X, family, obsWeights = NULL, ties_method = "last", ...) {
# X must be a dataframe, not a matrix.
if (is.matrix(X)) {
X = as.data.frame(X)
}
fit.glm <- suppressWarnings(glm(Y ~ ., data = X, family = family, weights = obsWeights))
# Extract p-values.
p_vals = summary(fit.glm)$coefficients[-1, 4]
return(rank(p_vals, ties.method = ties_method))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.