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
repeated time values within panel stataHi, I am fairly new to Stata, I've been trying to analyse my data for my research proposal. However,…
Standard errors for each replication(iteration) in bootstrapHello, I am trying to figure out if there is a way of saving all the individual standard errors one …
Local Projections,Hello Everyone, I need to know, How to normalize a shock to 1%of GDP in local projections Thank Y…
Independent t-test for differences other than 0Dear Stata Experts, I would like to run the independent t-test for the following dataset and want t…
Generating Single Change Variable In Panel DataHello Stata Folk! I'm reaching out with what I would guess is a question whose answer is very simpl…
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