google / google/CausalImpact

Relative Effects incorrect (wrong sign) when post-period mean is negative

Open
#31 4 comments 4 reactions 0 assignees View on GitHub
Dominant language
R
Stars
1.9k
Forks
264
PR merge metrics
No merged PRs in 30d

Description

See impact_inference.R, line 248:
```R
summary <- dplyr::mutate(summary,
RelEffect = AbsEffect / Pred,
RelEffect.lower = AbsEffect.lower / Pred,
RelEffect.upper = AbsEffect.upper / Pred,
RelEffect.sd = AbsEffect.sd / Pred)
```
I noticed negative RelEffect.sd in my `CausalImpactObject$summary` which is clearly the product of not using ```abs(Pred)``` as the denominator, as I believe it should be in each of these cases. In particular the upper and lower bounds are out of order, too, when ```Pred < 0 ```.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.