I am struggling to understand a non-inferiority analysis described in a paper by Meijer et al. 2009 for HPV-testing validation guidelines. The paper describes the test to be used as:

I've tried writing a function in R for this test, but the numbers I get are wildly off; maybe someone here can help me to get this right?

For the sensitivity test - a=65, b=5, c=3, d=0 (n=73)

For the specificity test - a=23, b=2, c=24, d=682 (n=731)

Thanks in advance!