
Compute Identifying Variation Weights
idid_weights.RdCompute regression weights describing the amount of variation used for identification.
Arguments
- reg
A regression object.
- var_interest
A string. The name of the main variable of interest.
- partial_iv
A boolean. If TRUE, partials out the part of the endogenous variables that are not explained by the instruments. If the regression is not an IV (or not generated by
AER::ivregorfixest::feolswith an instrumented part), the value ofpartial_ivhas no impact on the outcome of the function.- ...
Additional elements to pass to the regression function when partialling out controls.
Details
The weights correspond to the normalized leverage of each observation for the variable of interest after partialling out all controls.
They are computed by re-running the regression provided but replacing the independent variable by the variable of interest (and removing it from the set of regressors).
If the nature of the independent variable and of the variable of interest
are different, one may want to change the estimation.
For instance, if the independent variable is discrete and estimated via glm
with the argument family = "binomial" and the dependent variable is
continuous, one may want to provide the argument family = "gaussian"
to idid_weights.