You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a model has a lot of regressors (e.g., a within-model specified using a long list of dummies), margins can take a while to compute because the function calculates quantities for all the terms in the model. Often, the user only cares about a subset of those terms.
A simple way to speed things up would thus be to allow the user to specify a subset of variables for which they want to compute marginal effects and variances, and to ignore the rest.
PS: my understanding is that variances and unit_ses are calculated by looking at the names of the marginal effects data frame, so subsetting at the mfx level propagates further when users ask for variances or unit ses.
When a model has a lot of regressors (e.g., a within-model specified using a long list of dummies),
margins
can take a while to compute because the function calculates quantities for all the terms in the model. Often, the user only cares about a subset of those terms.A simple way to speed things up would thus be to allow the user to specify a subset of variables for which they want to compute marginal effects and variances, and to ignore the rest.
Looking at your code, it seems like adding that option would be pretty easy. A super simple approach could look like this: https://github.com/vincentarelbundock/margins/commit/137b8bbc6800d6e6cbf56c29dc628e35dbccadbc
With my fork installed, I get the following speedup:
Is this something you would want to implement? If so, what would you like to see in a PR?
The text was updated successfully, but these errors were encountered: