Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • fixed false positive rate

    Hi

    I am trying to get the sensitivity for a diagnostic test using a fixed false positive rate. I have been using SENSPEC which will give me the values for each subject but i can't seem to get values for a set false positive rate of 10%.

    The code i use to get the values for each subject is:

    senspec composite efw10, sensitivity(sensefw) specificity(specefw) fpos(fposefw)


    any suggestions?
    Last edited by chris flatley; 29 Nov 2016, 19:20.

  • #2
    Well, -senspec- is a user written program, available from SSC. You are asked to tell us that when you mention it in a post. (Please read the full FAQ.)

    In any case, -senspec- only calculates the values of these operating characteristics for the actual values of the classification variable (efw10) in your data set. It appears that you do not have a value of efw10 for which the false positive rate is exactly 10%. That being the case, the best you could do is sort the data on fposefw and then find the values nearest 10%, just above and just below. The value of efw10 you seek will be somewhere in between those, but it is not determined any more precisely than that by your data.

    Now, I anticipate that you may -list- or -browse- your data and find an observation that looks like 10%. But that is an illusion, the masking of the precision problem. The number 0.10 cannot be represented exactly in binary, so the number that is shown as 10% in Stata displays is just the closest approximation to that value that can be represented in binary within the precision of the storage type of the variable. For this reason, tests of equality of floating point numbers usually fail:

    Code:
    clear
    set obs 1
    gen x = 1/10
    assert x == 0.1 // PRODUCES false!
    Often in this situation, you can get around this with
    Code:
    assert float(x) == float(0.1) // PRODUCES true!
    So you might be able to get what you want with -list if float(fposefw) == float(0.1)-. But this does not always work, depending on whether there were other small rounding errors or sources of imprecision involved in the calculation of fposefw.

    Comment


    • #3
      Thanks Clyde.

      I suspected as much, but thought i would try the forum before throwing in the towel.

      Comment

      Working...
      X