Skip to content

Commit

Permalink
Catch for offset (see #28)
Browse files Browse the repository at this point in the history
  • Loading branch information
grantmcdermott committed Apr 29, 2023
1 parent 6c9d961 commit f095ae5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions R/etwfe.R
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,12 @@ etwfe = function(
est = fixest::feglm(Fml, data = data, notes = FALSE, family = family, ...)
}

# catch for offset if/when passing to emfx later
# hacky but works (i.e., overcomes the xpd / envir mismatch)
if (!is.null(est$call$offset) && !is.null(est$model_info$offset)) {
est$call$offset = stats::reformulate(est$model_info$offset)
}

## Overload class and new attributes (for post-estimation) ----
class(est) = c("etwfe", class(est))
attr(est, "etwfe") = list(
Expand Down

0 comments on commit f095ae5

Please sign in to comment.