Dear friends,

I've been running into some barriers with the estimation of spatial panel
models in "splm" and was hoping someone on the list might be able to
clarify an issue.  Judging from the examples for the package, it appears
that splm takes a listw object to define the spatial weights for the
estimation, and it appears this object need only be for a single
"time-slice" - that is, I don't need to provide nearest neighbors for every
timepoint in the data, because the current implementation of splm requires
balanced panels.  So, in other words, if I have 50 units over 25 years, I
would need a listw object defining the relations between the 50 units at
any one point in time in the dataset, not for *each* timepoint in the
dataset.  Is that correct?

If my understanding is correct, I have a second problem, which is that I
have a listw object generated from k-nearest neighbors and transformed
accordingly.  It has 121 units, the same as the units in my spatial panel
model, but I keep getting an error saying my spatial weights matrix is not
conformable.  Does anyone have any ideas what I might be doing wrong here?
 I'm wondering if somehow I'm messing up the order of the observations in
the process of defining the listw object, but I'm not sure if that's the
case.  The dataset is pretty large, and I didn't want to clog up anybody's
inbox, but I thought it might help if I included a code snippet here.  The
data frame, mod.1.splm, is ordered by time, then by observation, using
pdata.frame():

> coords <-
cbind(mod.1.splm$long[mod.1.splm$Year==1995],mod.1.splm$lat[mod.1.splm$Year==1995])
> dist.neighbors <- knearneigh(coords,4, longlat=TRUE)
> dist.neighbors <- knn2nb(dist.neighbors)
> dist.neighbors <- nb2listw(dist.neighbors)
>
> #AND TRY TO ESTIMATE A SPATIAL PANEL MODEL FROM EACH DATASET USING GM TO
INCORPORATE
> #INSTRUMENTAL VARIABLES
> formula <- polity_2 ~ lag(gdpcapppp) + lag(pivagdp) + lag(trade) +
lag(civil_war) + lag(regionaldiffusion) + lag(regionalgrowthdiffusion) +
lag(regionaldevelopmentdiffusion) + lag(edu)
> instr <- c("Coaly.Oil", "Lacustrine.Oil", "Shallow.Marine.Oil",
+                  "Deep.Marine.Oil")
> mod.1.est <- spgm(formula,
+                   data=mod.1.splm,
+                   listw=dist.neighbors,
+                   model="within",
+                   lag=TRUE,
+                   endog="total_oil_income_pc",
+                   instruments=instr,
+                   verbose=TRUE,
+                   method="w2sls"
+   )
Error in ivsplm(formula = formula, effects = effects, data = data, index =
index,  :
  Non conformable spatial weights

Thanks very much for your time and help,
Caleb Gallemore
Ph.D. Student
Department of Geography
The Ohio State University

	[[alternative HTML version deleted]]

