Commit fdd580b
Fix MultiPeriodDiD rank-deficient vcov/df computation (P1)
- Route MultiPeriodDiD through solve_ols with return_vcov=True and cluster_ids
- Calculate degrees of freedom using effective rank (non-NaN coefficients)
- Handle homoskedastic vcov case for rank-deficient matrices
- Add test_rank_deficient_design_warns_and_sets_nan test
This ensures MultiPeriodDiD properly handles rank-deficient design matrices
by warning users, setting NaN for dropped coefficients, and computing valid
SEs for identified coefficients only.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 8c18cac commit fdd580b
2 files changed
Lines changed: 73 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
873 | 873 | | |
874 | 874 | | |
875 | 875 | | |
876 | | - | |
877 | | - | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
878 | 888 | | |
879 | 889 | | |
880 | 890 | | |
881 | | - | |
882 | | - | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
883 | 894 | | |
884 | | - | |
885 | | - | |
886 | | - | |
887 | | - | |
888 | | - | |
889 | | - | |
890 | | - | |
891 | | - | |
892 | | - | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
893 | 898 | | |
894 | | - | |
895 | | - | |
| 899 | + | |
896 | 900 | | |
897 | | - | |
898 | | - | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
899 | 912 | | |
900 | 913 | | |
901 | 914 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1624 | 1624 | | |
1625 | 1625 | | |
1626 | 1626 | | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
1627 | 1670 | | |
1628 | 1671 | | |
1629 | 1672 | | |
| |||
0 commit comments