Good evening,
I'm trying to use "impacts" from package spdep, to get the impacts of unit changes in the independent variables, based on a fitted "lagsarlm" model. However, I'm running into two problems:
First, when I call "impacts", I get an error message that my weights are not row-standardised, when in fact they are. I can deal with this problem by coercing obj$listw_style to "W", but I'm wondering why this is happening at all.
Second, when I try to run simulations to generate estimates of the uncertainties for the estimates of the impacts, "impacts" seems not to acknowledge "R", and simply returns the estimates without any uncertainty. Can anyone tell me what I'm doing wrong (i.e., how I can get a series of simulations instead)?
The code I'm using is below.
Many thanks in advance for any assistance.
- Malcolm
oxw <- oxw/apply(oxw, 1, sum) # this is the weights matrix
table(apply(oxw, 1, sum)==1, useNA="always") # confirming rows sum to 1