JanDitzen / xtbreak

Testing and Estimation of structural breaks in Stata
https://janditzen.github.io/xtbreak/
16 stars 10 forks source link

Only balanced panels allowed error #12

Closed gabrielcruzfer closed 4 months ago

gabrielcruzfer commented 11 months ago

Hi!

I am working with a balanced panel dataset, which consists of N = 200,000 individuals observed over T = 18 time periods. Each individual in the panel has only two observations. Here are the details of my dataset:

Panel variable: mrun (weakly balanced)
 Time variable: group_mindset, 1 to 18, but with gaps
         Delta: 1 unit 

I've been trying to use the "xtbreak" command in my analysis. However, when I attempt to run it, I receive the following error message:

Only balanced panels allowed.
unrecognized command

I'm uncertain whether this command is appropriate for my data given its characteristics. Could you please provide guidance on how to proceed or suggest an alternative approach?

Thank you so much

JanDitzen commented 11 months ago

Hi Gabriel, thank you very much for your interest in xtbreak.

xtbreak requires a strongly balanced dataset, your dataset is only weakly balanced. To me it looks like some units are missing some time periods. Can you try to remove those?

Please let me know if you have further questions.

Best

gabrielcruzfer commented 11 months ago

Hi Jan, Thank you for your response. I'm currently exploring alternative methods for detecting structural breaks in cross-sectional data. Specifically, I'm interested in identifying breakpoints within a control variable. Do you have any suggestions or insights in this regard?