Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyfixest/estimation/feglm_.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def __init__(
self._Xbeta = np.empty(0)

self._method = "feglm"
self._supports_sensitivity_analysis = False

def prepare_model_matrix(self):
"Prepare model inputs for estimation."
Expand Down
1 change: 1 addition & 0 deletions pyfixest/estimation/feiv_.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ def __init__(
self._support_iid_inference = True
self._supports_cluster_causal_variance = False
self._support_decomposition = False
self._supports_sensitivity_analysis = False

def wls_transform(self) -> None:
"Transform variables for WLS estimation."
Expand Down
9 changes: 8 additions & 1 deletion pyfixest/estimation/feols_.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
_get_ritest_stats_slow,
_plot_ritest_pvalue,
)
from pyfixest.estimation.sensitivity import SensitivityAnalysis
from pyfixest.estimation.solvers import solve_ols
from pyfixest.estimation.vcov_utils import (
_check_cluster_df,
Expand Down Expand Up @@ -407,6 +408,7 @@ def _not_implemented_did(*args, **kwargs):
self.test_treatment_heterogeneity = _not_implemented_did
self.aggregate = _not_implemented_did
self.iplot_aggregate = _not_implemented_did
self._supports_sensitivity_analysis = True

def prepare_model_matrix(self):
"Prepare model matrices for estimation."
Expand Down Expand Up @@ -2663,6 +2665,11 @@ def update(

return beta_n_plus_1

def sensitivity_analysis(self) -> SensitivityAnalysis:
if not self._supports_sensitivity_analysis:
raise ValueError("Sensitivity Analysis is only supported for OLS methods (Feols).")
return SensitivityAnalysis(self)


def _feols_input_checks(Y: np.ndarray, X: np.ndarray, weights: np.ndarray):
"""
Expand Down Expand Up @@ -2910,4 +2917,4 @@ def _deparse_vcov_input(vcov: Union[str, dict[str, str]], has_fixef: bool, is_iv
"""
)

return vcov_type, vcov_type_detail, is_clustered, clustervar
return vcov_type, vcov_type_detail, is_clustered, clustervar
1 change: 1 addition & 0 deletions pyfixest/estimation/fepois_.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ def __init__(
self._Y_hat_response = np.array([])
self.deviance = None
self._Xbeta = np.array([])
self._supports_sensitivity_analysis = False

def prepare_model_matrix(self):
"Prepare model inputs for estimation."
Expand Down
Loading
Loading