I need to simulate the inverse of a function that has no closed-form solution, and I was wondering if there's a clean way to do that in Stata. So far I've been doing something along the lines of:
and then just matching values of y to values in my data, which is not at all practical for large datasets. I know Stata can graph continuous functions using twoway function, but is there a way to exploit this ability to back out values of x from a given value of the function?
Code:
set obs 1000 gen x = _n gen y = expression in terms of x
Comment