diff --git a/.gitignore b/.gitignore index 603dc16..92c5123 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,29 @@ -.idea +# Python __pycache__/ +*.py[cod] + +# Virtual environments +.venv/ +venv/ + +# Packaging / build artifacts +*.egg-info/ +build/ +dist/ + +# Testing and coverage +.pytest_cache/ +.coverage +.coverage.* +htmlcov/ +coverage.xml + +# Jupyter .ipynb_checkpoints + +# Editors / IDEs +.idea/ +.vscode/ + +# Project specific backup/ diff --git a/sensemakr/sensitivity_plots.py b/sensemakr/sensitivity_plots.py index 51890f5..ee2f9fd 100644 --- a/sensemakr/sensitivity_plots.py +++ b/sensemakr/sensitivity_plots.py @@ -624,7 +624,7 @@ def extract_from_model(model, treatment, benchmark_covariates, kd, ky, r2dz_x, r se = model_data['se'] dof = model_data['dof'] try: - estimate, se = float(estimate), float(se) + estimate, se = float(estimate.iloc[0]), float(se.iloc[0]) except: sys.exit('Error: The estimated effect and standard error must be numeric.') diff --git a/sensemakr/sensitivity_statistics.py b/sensemakr/sensitivity_statistics.py index 1551680..0d2f057 100644 --- a/sensemakr/sensitivity_statistics.py +++ b/sensemakr/sensitivity_statistics.py @@ -174,7 +174,7 @@ def partial_r2(model=None, covariates=None, t_statistic=None, dof=None): model_data = model_helper(model, covariates=covariates) t_statistic = model_data['t_statistics'] dof = model_data['dof'] - return (t_statistic ** 2 / (t_statistic ** 2 + dof))[0] # extracts float + return (t_statistic ** 2 / (t_statistic ** 2 + dof)).iloc[0] # extracts float else: return t_statistic ** 2 / (t_statistic ** 2 + dof)