Skip to content

Instantly share code, notes, and snippets.

@GreyZephyr
GreyZephyr / list.md
Created November 1, 2020 22:38 — forked from ih2502mk/list.md
Quantopian Lectures Saved
@GreyZephyr
GreyZephyr / makeglm.R
Created October 7, 2023 11:28 — forked from MrFlick/makeglm.R
makeglm.R: Creates a "fake" glm object with specific coefficients that you can use for predicting without fitting a model first
makeglm <- function(formula, ..., family, data=NULL) {
dots <- list(...)
out<-list()
tt <- terms(formula, data=data)
if(!is.null(data)) {
mf <- model.frame(tt, data)
vn <- sapply(attr(tt, "variables")[-1], deparse)
if((yvar <- attr(tt, "response"))>0)
vn <- vn[-yvar]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.