Announcement

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

  • Extract values of TN, FP, TP and FN stata

    Dear Stata exper,
    Wonder how to extract values of TN, FP, TP and FN into seperate variables in stata
    For example following logistic regression to predict a binary outcome using a score value, I know these variables are generated for ROC curve for model accuracy, but i want them to be seperately retained in my var list, so as i can apply them in further tests like midas package.
    appreciate help
    Thanks

  • #2
    Type return list after you run estat classification. You'll see a list of scalars. These are like temporary variables stored in memory that aren't part of your dataset. You can, however, save them as permanent scalars or as actual variables, e.g.

    Code:
    gen false_positive = r(P_p0)
    Note the description of the scalars in the estat classification manual (see Stored Results).
    Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

    When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

    Comment

    Working...
    X