Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix SLX impacts (closes r-spatial#23) by scaling lm coefs
As documented in issue r-spatial#23 and doi.org/10.13140/RG.2.2.11269.68328 the average indirect effects of the SLX model are not correct for non-row-stochastic matrices. This commit fixes that. To be maximally non-invasive to users, I apply the necessary scale factor to the coefficients of the underlying LM model. This means that the coefficients *can* be directly interpreted as partial effects -- which is probably the way it's being done anyways. This could also be addressed in a more involved manner (for users and coders) -- we could apply the scale factor only to the indirect impacts (returned by 'impacts()') and only adjust the model used to compute total effects. I did not pursue this as it (1) would require more code, (2) be more contrived, and (3) does not reflect usage patterns that I would expect.
- Loading branch information
a9b9874
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the code was re-formatted, I have no idea what the real diff is. I can't accept things I can't read,