I have a code that partially works to create a spatial matrix:
egen id = group(IOCode),label lname(IOCode)
spset id
local var v1 v2 v3 v4 v5
mata: st_matrix("c",st_data((1,5),"`var'"))
matrix coln c= `var'
mat list c
spmatrix spfrommata Wmat=c id
Although mat list c shows the matrix, spmatrix leads to the error: matrix c not found
I've also tried:
. local var v1 v2 v3 v4 v5
. mata:
------------------------------------------------- mata (type end to exit) ----------------------------------------------------------------------------------------------------------------
:
: id = st_data(., "_ID")
:
: c = st_matrix("c",st_data((1,5),"`var'"))
:
: end
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
.
. spmatrix spfrommata myIdist = c id
with the error: number of rows in matname must be > 0
Related Posts with Create and export spatial matrix: spmatrix does not find the matrix created in Mata
Need help with creating a Growth Incidence Curve in Stata. I am very new to this wonderful software.Hey there! My name is Philip and I'm currently studying for a bachelors degree in economics. I reall…
Plot with text not exporting to PDFDear all. What I am about to describe, happens happens in both Stata 15 and Stata 16, running on Wi…
Panel regression with moderatorDear all, I am conducting a fixed effects panel regression with a IV several DVs and a moderator (M…
Shifting values leftwards to replace missingCan anyone advise about how to replace missing values with the next value to the right of the same t…
creating a percentage graph barDear Statalist I would like to make a graph bar but with percentages instead of the count. However,…
Subscribe to:
Post Comments (Atom)
0 Response to Create and export spatial matrix: spmatrix does not find the matrix created in Mata
Post a Comment