Dear Statalisters,
My problem is the following: Assume I want to pass a list of several variable names' lists from Mata to Stata. The following bit of code is an example of what I have in mind:
Then how can I extract each list of variables in Mata to build matrices using st_view or st_data? As a matter of fact, I am not aware of anything as straightforward as what is natural in the case of a unique list of variables' names, where
is possible.
Regards,
Yannick Guyonvarch
My problem is the following: Assume I want to pass a list of several variable names' lists from Mata to Stata. The following bit of code is an example of what I have in mind:
Code:
clear all set obs 1000 local list_of_lists "" set seed 1 gen x1=rnormal() gen x2=rnormal() scalar a=`""x1""' local list_of_lists "`list_of_lists' a" scalar b=`""x1 x2""' local list_of_lists "`list_of_lists' b"
Code:
mata: X=st_data(.,"x1 x2")
Regards,
Yannick Guyonvarch
Comment