Announcement

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

  • Error with pmcalplot package

    I have installed the package pmcalplot in my Stata version 18, to help me with the calibration plot for my risk prediction model. I have run into an error (see below) when I run the commands. The same error shows with my data buut also with the data provided in the package. Below are the steps

    webuse lbw, clear
    gen val = runiform()<.4
    logistic low age lwt i.race smoke ptl ht ui if val==0
    predict p_dev

    When i run the next command I get the error message
    pmcalplot p_dev low if val==0, ci

    The error message is shown next:
    Binary option selected: Calibration plot for logistic prediction model displaying...
    command running is unrecognized
    r(199);

    How can I proceed?

  • #2
    pmcalplot is from SSC (FAQ Advice #12). There is a command named running from the Stata Journal that pmcalplot calls in its routine.

    sed9_2 from http://www.stata-journal.com/software/sj5-2
    SJ5-2 sed9_2. Symmetric nearest neighbor smoothing / Symmetric nearest
    neighbor smoothing / by Peter Sasieni, Wolfson Institute of Preventive
    Medicine / Patrick Royston, MRC Clinical Trials Unit / Nicholas J. Cox,
    Durham University / Support: [email protected]
    Install using

    Code:
    net install sed9_2, from(http://www.stata-journal.com/software/sj5-2)
    and you should be good to go.

    Comment


    • #3
      Thank you so much! This worked in an instant

      Comment


      • #4
        I am using STATA 18, pmcalplot is already installed however, it did not allow to reduce the range on both axis of the plot. Then, I replaced it using
        net install sed9_2, from(http://www.stata-journal.com/software/sj5-2) replace code. I run pmcalplot lungcancer_pr lungcancer2, range(0 0.025), it had produced plot with range 0-0.025 on the y-axis (observed outcomes) and 0-0.4 on x-axis( expected outcome)

        Comment


        • #5
          If your question is about truncating the axis, then Stata generally does not allow this. The -range()- suboption within -yscale()- or -xscale()- can only expand the axis. But you can use an -if- qualifier to choose a subsample, but note this in many cases will not be equivalent to plotting using the entire sample and truncating the axis.

          Comment


          • #6
            I can't think of a valid reason to restrict the plotting region as you say you want to do. The entire point of the such plots to get a holistic view of the the prognostic/diagnostic performance of your model, meaning you need to see the entire predicted-observed probability space.

            Comment

            Working...
            X