How can I calculate the optimal formula for predicting an outcome based on a lab value? How can I calculate the optimal formula for predicting an outcome based on a lab value?
e.g. a rise in liver function tests can be predictive of liver disease.
Having liver disease (or not) is the outcome I want to predict, based upon the change in the value of liver function tests during the last year.
Is there I way to calculate all potential formulas for prediction and compare them?
e.g.

*

*liver value x 2 during the last year

*liver value x 3 during the last year

*liver value x 2 + 2 during last year

*and so on....

 A: NO
Let $p$ be the probability of liver failure, and let $x$ be the change in the liver value that you want to use to predict liver failure.
Every possible formula would include:
$$
p = \sin(x)\\
p = \sin(2x)\\
p = \sin(3x)\\
\vdots
$$
There are an infinite number in this sequence alone, so the answer is that you cannot list out all of the potential formulae and try out every single one.
What you can do is learn about regression and regression-strategies. The author of a good textbook called Regression Modeling Strategies, Frank Harrell, is a biostatistician, even.
EDIT
The way that a regression would typically work is that you would posit that the formula is of a form like $p = \beta_0 + \beta_1x$, and then you would let the machinery of optimization figure out the $\beta_0$ and $\beta_1$ for your particular data. In that sense, you don't have to list and try out $p = 2x$, $p = 3x$, $p = 2x + 2$, etc. Once you give a functional form like $p = \beta_0 + \beta_1x$, the optimization procedure (which has mathematical theory but mostly operates under the hood from the standpoint of a statistician) would figure out the best $\beta_0$ and $\beta_1$.
A good place to start is simple linear regression and ordinary least squares. That will lead you to ordinary least squares for multiple regression (multiple predictors) and then to logistic regression for the categorical outcome that you have and predicting the probability of that outcome.
What regression won't do (at least not easily) is tell you if you should prefer $p = \beta_0 + \beta_1x$ or $p = \beta_0 + \beta_1x + \beta_2x^2$ or $p = \sin(\beta_0 + \beta_1x$). You have to pick that form, and picking that is a major part of the regression-strategies I mentioned.
