I have been learning the basic terminology for how to think about binary tests involving medical tests. The basic terms are here in this table
This is the confusion matrix.
My issue is the following. Note, I assume $T = N + P$ is the size of the total population. Then "accuracy" of the test is defined as
$$ACC = \frac{TP+TN}{T}$$
where you have essentially the cases you diagnosed correctly divided by the total cases you ran the test on.
But for many diseases, the disease will not be prevalent, as defined by
$$PREV = \frac{P}{T}$$
This means that $ACC$ can be very biased. Suppose our model is "assume no one has a disease" and suppose 98% of the population doesn't have it, then our accuracy would be fabulous because we would be right 98% of the time, but have a 0 True Positive Rate.
Is there a measure for test accuracy that essentially weights the $TP$ and $TN$ by prevalence such that
$$ACC_{2} = \frac{TP\cdot w_{TP} + TN \cdot w_{TN}}{T}$$
where $w_{TP}$ and $w_{TN}$ are somehow determined by the prevalence of the disease?
I want something that in other words gives me an estimate of the overall accuracy that uses the prevalence to weight the accuracy to avoid having low prevalence of a disease lead to a biased overall estimate of accuracy.
