Hi,
I am writing a stata program. I would like to have as one of the arguments of the stata program to be a mata function. Can I get some advice if this is feasible and if it is, what is the best way to go about doing this? It would be great if someone can direct me to the relevant documentation.
For example, my code will look something like the following:
Secondly, I would also like to know if there is a way to allow mata functions to accept other mata functions as an argument. Thanks.
I am writing a stata program. I would like to have as one of the arguments of the stata program to be a mata function. Can I get some advice if this is feasible and if it is, what is the best way to go about doing this? It would be great if someone can direct me to the relevant documentation.
For example, my code will look something like the following:
Code:
program define logdensity syntax varlist(max = 1) [if] [in], g(mata function) marksample touse mata: PS_estimator(varlist, g) end mata void PS_estimator(varlist, g){ "performs calculation at the background that involves the g function" } end
Comment