Hi,
I'm trying to do a very standard spatial analysis. The aim is to run ML and 2SLS estimations with spregress. I've successfully run this several times and then after I changed one of the excel files I was using it suddenly stopped working, or better, it does work, but it creates empty matrices. Here's my log:
.
. clear all
. import excel "network_contiguity_MLE_FULL.xlsx", sheet("network_contiguity_MLE_FULL") firstrow
(34 vars, 6,633 obs)
. .
. gen y = AIM15 - AIM13
(153 missing values generated)
.
. xtset id
panel variable: id (balanced)
. spset id
Sp dataset
data: cross sectional
spatial-unit id: _ID (equal to id)
coordinates: none
linked shapefile: none
.
. mata
: mata matuse W_network_full_U /*Upload Matrix X and Vector v from file wmatrix*/
(loading X[6650,6650], v[6650,1])
: end
.
. spmatrix spfrommata ZW = X v
(weighting matrix contains 6650 islands)
.mata
:sum(X)
4725
The last line is to show that the mata matrix it is not empty, yet it creates a matrix with as many islands as number of observations, so I guess empty?
This code still works using a different mata matrix, but except for the position of 1s and 0s they look identical to me.
I've been struggling for days with this, and I really cannot figure it out.
Thanks a lot for any help.
Related Posts with Spmatrix creating empty weighting matrices
Variable not found r(111) when using midasHi, I am using midas to create a forest plot in Stata/MP 13.1 with the following command: midas TP …
Problems with asdoc, add more than one model in a tableHey statalists, I tried to make a table like the one at the picture.That are the results of the lo…
F stadisticHello, I have the following problem: Number of obs = 559 F(5, 552) = . Prob > F = . R-squared = …
Multiple imputations and descriptive statisticsSo, I just found out that using tab when you have multiple imputations is a big no no. This was a bi…
Collinearity between two country variables, one nominal (country name) and the other metric (globalisation level)Hi I experience heavy (perfect) multicollinearity between a control variable and my main independen…
Subscribe to:
Post Comments (Atom)
0 Response to Spmatrix creating empty weighting matrices
Post a Comment