I'm using stata to get intial values for an optimization problem and then mata to do the optimization. A snipped of some crude code that works looks like
reg y x1 x2 x3 x4
mata:
/* I need to create the y and X matrix again*/
y=st_data(.,"y")
X=st_data(.,"x1 x2 x3 x4 ")
I would like to be able to change the list of covariates (adding or dropping some) without having to do so TWICE (to minimize errors). Is there a good way to share the list of covariates?
reg y x1 x2 x3 x4
mata:
/* I need to create the y and X matrix again*/
y=st_data(.,"y")
X=st_data(.,"x1 x2 x3 x4 ")
I would like to be able to change the list of covariates (adding or dropping some) without having to do so TWICE (to minimize errors). Is there a good way to share the list of covariates?
Comment