Hi All

This is my first post but I have learnt a lot from this forum in previous years.

I am trying to estimate a Spatial Panel Model (25 countries and 120 months). I defined the panel/sp setting according to the SP manual from STATA. My W matrix is user defined based on trade flows from these countries. To import and read the W matrix I followed this steps: https://www.statalist.org/forums/for...port-csv-files

However, when I try to estimate the panel model (using spxtregress) I have the error "insufficient number of observations".

I read in the manual (https://www.stata.com/manuals/spspmatrixcreate.pdf) that when working with panel "We must restrict spmatrix create to one observation per panel, which is easy to do using an if statement" Thus, the W matrix will be appropriate for creating spatial lags for any year.

I think I am missing this step but there is no instructions of how set up W matrix when is imported (from csv/txt). I would appreciate any suggestion.

Thanks