naoki-egami / DIDdesign

R package DIDdesign: Analyzing Difference-in-Differences Design
GNU General Public License v2.0
35 stars 7 forks source link

Fix zero variance error #37

Closed sou412 closed 9 months ago

sou412 commented 9 months ago

Before the fix

When the outcome has zero variation in the control group, the function did_check() fails with the following error message:

# Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : 
#   NA/NaN/Inf in 'y'

After the fix

Test

See this doc for the details. The update is tested against the data shared offline.