-
Notifications
You must be signed in to change notification settings - Fork 65
Closed
Description
Small bug found in model.matrix. If there are no collinear fixed effects, this fails. A first check to make sure that there are collinear variables can fix this. Something like: if(!"collin.var" %in% names(object))
Lines 7887 to 7894 in 6c99dfe
if(collin.rm){ | |
qui = which(colnames(linear.mat) %in% object$collin.var) | |
if(length(qui) == ncol(linear.mat)){ | |
linear.mat = NULL | |
} else if(length(qui) > 0){ | |
linear.mat = linear.mat[, -qui, drop = FALSE] | |
} | |
} |
Reprex:
library(palmerpenguins)
library(fixest)
est <- feols(bill_length_mm ~ 0 | species, data = penguins)
#> NOTE: 2 observations removed because of NA values (LHS: 2).
model.matrix(est)
#> Error in if (length(qui) == ncol(linear.mat)) {: argument is of length zero
Created on 2021-11-09 by the reprex package (v2.0.0)
Metadata
Metadata
Assignees
Labels
No labels