+ Reply to Thread
Results 1 to 2 of 2

Thread: Reverse Engineering a calculator

  1. #1
    Points: 20,006, Level: 89
    Level completed: 32%, Points required for next Level: 344

    Thanked 20 Times in 19 Posts

    Reverse Engineering a calculator


    A colleague in a different department posed an interesting question that I've been giving more thought to lately. Basically, a scientist here has developed an online calculator for predicting risk of an event. You can go in an enter attributes (age, sex, etc) and it will spit out a risk score.

    I'm convinced on the backend it's using some sort of a multivariable logistic regression. If I wanted to reverse engineer the regression equation, how might I do that (theoretically)? I have no real interest in determining it, and in fact I can probably locate the published paper the calculator was created with and view the estimates, but conceptually, if I didn't have access to it, how might I do that?

    Assume there are 4 inputs - age(categorical), sex(binary), height(continuous), and prior history of some disease (binary).

    I imagine using the calculator several times under a variety of situations, possibly leaving one particular input at a time, while setting the other 3 to zero. Can anyone help formulate how I might recover the regression parameters? I'm really curious now!

    Last edited by jamesmartinn; 03-30-2017 at 09:31 AM.

  2. #2
    Omega Contributor
    Points: 38,303, Level: 100
    Level completed: 0%, Points required for next Level: 0
    hlsmith's Avatar
    Not Ames, IA
    Thanked 1,185 Times in 1,146 Posts

    Re: Reverse Engineering a calculator

    I did this same thing about two years ago, to apply new guidelines for risk to historic patients to forecast how many may need to change their pharmaceuticals use. So you end up scoring new data, building the model and examining it on different possibilities. My model had a very small error compared to the calculator, which I couldn't determine if it was a rounding or perhaps flooting point issue (the models had many terms, so it was difficult to figure out)? The error only impacted a few people at the hundredths place in risks. So after I built it, I could run data through their calculator and then mine to compare.

    In particular, I did it for this heart risk calculator: http://www.cvriskcalculator.com/
    I used their model coefficients and had to know the model's structure, e.g., what data transformations they used and interaction terms. Their calculator is actually built from 4 logistic regressions if I remember correctly, since they stratified patients by risk due to interactions. Luckily for me they published a committee document on the model that was like 26 pages long.

    This was our paper: https://www.ncbi.nlm.nih.gov/pubmed/27026635
    Stop cowardice, ban guns!

+ Reply to Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Advertise on Talk Stats