9/2/24
diabetes | HbA1c | rank |
---|---|---|
No | 5.4 | 1.0 |
No | 5.6 | 2.0 |
Yes | 5.8 | 3.5 |
No | 5.8 | 3.5 |
Yes | 6.4 | 5.0 |
Yes | 6.9 | 6.0 |
No | 7.0 | 7.0 |
Yes | 9.3 | 8.0 |
\[\begin{equation} W = R^*_1 - \frac{n_1(n_1 + 1)}{2} \end{equation}\]
Wilcoxon test using the full data:
W
754851.5
[1] 4.413508e-270
Notice that is much more general compared to the t-test:
Null: Both groups have the same mean
Alt: Both groups have different means
Exact and asymptotic distributions of \(W\) were derived and can be used to calculate p-value1
\[\begin{equation} c = \frac{\bar{R}_2 - \frac{n_2+2}{2}}{n_1} \end{equation}\]
\(\bar{R}_2\): mean of ranks in group 2
\(n_1, n_2\) sample size in groups 1,2
asht::wmwTest
: Estimate of \(c\) and Confidence Interval (Fay and Malinovsky 2018)
There is a 0.86 probability that diabetes patients have higher HbA1c compared to undiagnosed patients.
Let \(Y = 1, 2, ..., k\) be the k unique values of Y:
\[\begin{equation} Pr(Y \ge j | X) = \frac{1}{1 + exp[-(\alpha_j + X\beta)]} = expit(\alpha_j + X\beta) \end{equation}\]
\[\begin{equation} exp(\beta) = \frac{\text{Odds } Y \ge j | X = x + 1}{\text{Odds } Y \ge j | X = x} \end{equation}\]
What if non-PO?
Diabetes patients have 21.4 times greater odds of having higher HbA1c compared to undiagnosed patients.
\[\begin{equation} c = \frac{\text{OR}^{0.6453}}{1 + \text{OR}^{0.6453}} \end{equation}\]
Besides the odds ratio and c-index, PO also supports several other important estimators:
rms::Quantile.orm
rms::Mean
nhgh
diabetes dataset…violations of the proportional odds assumption usually do not prevent the PO model from providing a reasonable treatment effect assessment. - Violation of Proportional Odds is Not Fatal
Simulations show robustness of PO model under non-PO:
Resources for assessing impact of PO assumption
rms::orm
claims to efficiently handle “over 6000 distinct values” - I haven’t tested on larger than this.