Skip to content

sunab() inconsistencies #589

@ocolluphid

Description

@ocolluphid

Inconsistent Results with sunab() Function

Hi fixest team!

Thank you for the highly performant implementation of Sun-Abraham via the sunab() function! However, I'm encountering inconsistent results where regression output sometimes contains NAs despite no detected collinearity issues, and sometimes rerunning the same regression and data occasionally yields complete results without nulls (and in both cases the R2 and RMSE match, despite the null coefficients.

Potential Sources of Inconsistency

I suspect the following factors might be causing these inconsistencies. It would be helpful to clarify these points in the sunab() documentation:

1. Fixed Effects Time Period Matching

As mentioned in this thread with Kyle, we need FEs on top of sunab(). I'm using year FEs while the cohort and current periods in sunab() are expressed in quarterly units. @kylebutts

Question: Does the FE time period have to match the time units in sunab()?

2. Period and Cohort Format Compatibility

When expressing period as a relative period (RP), can I pass cohort as a string format like "2022Q1" instead of a date format like "01-01-2022"?

3. Never-Treated Group Detection

I'm concerned that cases with NAs might result from the function not automatically detecting the "never treated" group, even though I assign them a cohort date years/quarters before the date range of interest. I'm attempting to explicitly specify the "never treated" date using ref.c.

Questions:

  • Would passing the never-treated reference as a string cause problems?
  • Are there examples in the documentation showing proper ref.c usage?
  • Does specifying ref.c improve consistency between runs by avoiding imputation of the "never treated" group?

4. Never-Treated Group Timing

In the documentation example, 1000 is set as the year treated for the "never treated" group. Does it matter whether we set the never-treated year outside the range to the future or to the past?

Request

In addition to addressing these questions here, does it also make sense to address them in the documentation via examples? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions