Hello,
I have a data set of 40 countries for 11 years from 2005 to 2015. I'm trying to create a spatial weights matrix with coordinates X and Y for each country. My data set in STATA looks like this
USA 2005
USA 2006
USA 2007
....
France 2005
France 2006
France 2007
....
When I enter the coordinates for each country in the data set, do I have to repeat the same coordinates for each country in every year?
I have tried to do that but when I run the following regression:
global xcoord X
global ycoord Y
global band 100
spatwmat, name(W) xcoord($xcoord) ycoord($ycoord) band(0 $band) standardize eigenval(E)
Then, it shows the following error message:
matsize too small
You have attempted to create a matrix with too many rows or columns or attempted to fit a model with too many variables. You need to increase
matsize; it is currently 400. Use set matsize; see help matsize.
If you are using factor variables and included an interaction that has lots of missing cells, either increase matsize or set emptycells drop to
reduce the required matrix size; see help set emptycells.
If you are using factor variables, you might have accidentally treated a continuous variable as a categorical, resulting in lots of categories.
Use the c. operator on such variables.
So, my question is how do I create a spatial weights matrix using coordinates for panel data? How to I enter coordinates correctly for panel data? Note that in my data set, there are 40 countries so the weight matrix is 40x40. However, if I enter the coordinates as the panel data format as the above, I will have to repeat the same coordinates 11 times (for 11 years) for every country.
What does band actual mean? is it the difference in coordinate, how to translate the band into actual distance such as miles or kilometers?
I have a data set of 40 countries for 11 years from 2005 to 2015. I'm trying to create a spatial weights matrix with coordinates X and Y for each country. My data set in STATA looks like this
USA 2005
USA 2006
USA 2007
....
France 2005
France 2006
France 2007
....
When I enter the coordinates for each country in the data set, do I have to repeat the same coordinates for each country in every year?
I have tried to do that but when I run the following regression:
global xcoord X
global ycoord Y
global band 100
spatwmat, name(W) xcoord($xcoord) ycoord($ycoord) band(0 $band) standardize eigenval(E)
Then, it shows the following error message:
matsize too small
You have attempted to create a matrix with too many rows or columns or attempted to fit a model with too many variables. You need to increase
matsize; it is currently 400. Use set matsize; see help matsize.
If you are using factor variables and included an interaction that has lots of missing cells, either increase matsize or set emptycells drop to
reduce the required matrix size; see help set emptycells.
If you are using factor variables, you might have accidentally treated a continuous variable as a categorical, resulting in lots of categories.
Use the c. operator on such variables.
So, my question is how do I create a spatial weights matrix using coordinates for panel data? How to I enter coordinates correctly for panel data? Note that in my data set, there are 40 countries so the weight matrix is 40x40. However, if I enter the coordinates as the panel data format as the above, I will have to repeat the same coordinates 11 times (for 11 years) for every country.
What does band actual mean? is it the difference in coordinate, how to translate the band into actual distance such as miles or kilometers?
Comment