I have a perfectly balanced dataset with 25 countries and 10 years correctly xtset and spset in Stata15 for a spatial regression analysis.
I created a W connectivity matrix and, in order to save thm for other datasets and works, I would like to create some lagged variables with Spgenerate.
There are no specifications for panel data in the manual (like the ones for producing the matrix by using an if) but when I try to create the lagged variable
Stata returns me the following msg:
_IDs in weighting matrix W do not match _IDs in estimation sample
There are places in W not in estimation sample and places in estimation sample not in W.
I believe it has something to do with the panel structure, but I'm not at all sure, and I cannot figure out something different or a solution.
NB Running a spxtregress with those same data does not produce any error, and Stata is able to estimate the model.
Any suggestions?
Thanks a lot
Marco Giuliani
PS I tried with diverse matrices, including idistance, and even the type of normalization chosen does not make any difference
I created a W connectivity matrix and, in order to save thm for other datasets and works, I would like to create some lagged variables with Spgenerate.
Code:
spmatrix create contiguity W if year==2007, normalize(row) replace
Code:
spgenerate Wgdp =W*gdp
_IDs in weighting matrix W do not match _IDs in estimation sample
There are places in W not in estimation sample and places in estimation sample not in W.
I believe it has something to do with the panel structure, but I'm not at all sure, and I cannot figure out something different or a solution.
NB Running a spxtregress with those same data does not produce any error, and Stata is able to estimate the model.
Any suggestions?
Thanks a lot
Marco Giuliani
PS I tried with diverse matrices, including idistance, and even the type of normalization chosen does not make any difference

Comment