Announcement

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

  • New version of punafcc on SSC

    Thanks as always to Kit Baum, a new version of the punafcc package is now available for download from SSC. In Stata, use the ssc command to do this, or adoupdate if you already have an old version of punafcc.

    The punafcc package is described as below on my website. The new version adds the ability to calculate the correct population unattributable and attributable fractions for survival data after fitting a competing risks regression using stccreg, as well as after fitting a Cox regression using stcox. I would like to thank Maryam Darvishian of the University of British Columbia in Canada for suggesting this improvement. I would also like to thank Isabel Canette of StataCorp for passing the news to the developers when I reported a bug in margins that I discovered while developing this new version (reported to Stata TechSupport on 09 Decenber 2016), and the StataCorp developers for fixing this bug in the update of Stata Version 14.2 dated 19 December 2016.

    Best wishes

    Roger

    -----------------------------------------------------------------------------------------
    package punafcc from http://www.imperial.ac.uk/nhli/r.newson/stata14
    -----------------------------------------------------------------------------------------

    TITLE
    punafcc: Population attributable fractions for case-control and survival studies

    DESCRIPTION/AUTHOR(S)
    punafcc calculates confidence intervals for population attributable
    and unattributable fractions in case-control or survival studies.
    punafcc can be used after an estimation command whose parameters are
    interpreted as log rate ratios, such as logit or logistic for
    case-control data, or stcox for survival data. It estimates the log
    of the mean rate ratio, in cases or deaths, between 2 scenarios, a
    baseline scenario ("Scenario 0") and a fantasy scenario ("Scenario
    1"), in which one or more exposure variables are assumed to be set
    to particular values (typically zero), and any other predictor
    variables in the model are assumed to remain the same. This ratio
    is known as the population unattributable fraction (PUF), and is
    subtracted from 1 to derive the population attributable fraction
    (PAF), defined as the proportion of the cases or deaths attributable
    to living in Scenario 0 instead of Scenario 1.

    Author: Roger Newson
    Distribution-Date: 11january2017
    Stata-Version: 14

    INSTALLATION FILES (click here to install)
    punafcc.ado
    punafcc_p.ado
    punafcc.sthlp
    -----------------------------------------------------------------------------------------
    (click here to return to the previous screen)


  • #2
    Dear smart Stata people,

    I want to compute population attributable fractions using fixed effects models, but am at a loss how best to do so.
    I have used punaf to good effect in random effects models (thank you very much!), but I cannot do so with fixed effects models, which do not play well with margins.
    I am using Add Health data, three waves, examining fertility-related outcomes. The Hausman test is significant, so fixed effects models are likely preferable. I would like to estimate, for example, the proportion of depression in ever-pregnant women at terminus attributable to prior involuntary pregnancy loss (miscarriage, ectopic preg, etc). This is straightforward using punaf with a re model, but only spits me red pixels with a fe model. Is it possible to do so with a fixed effects model? How do I do it, with punaff or punaffcc or by some other means?

    Thank you!

    Not so smart Stata user, aka Paul
    Stata Version 13

    Comment


    • #3
      Hello Paul. I would be more able to comment on your problem if I saw the "red pixels" that punaf has been spitting out, and the commands which caused these "red pixels" to be spat out. (I suspect that these pixels are really bytes, as I never designed punaf or punafcc to do anything with pixels.)

      Comment


      • #4
        Paul: please see the following link regarding the calculation of marginal effects after a fixed effects model: https://www.stata.com/statalist/arch.../msg00889.html. I suspect it is relevant here.

        Comment


        • #5
          Hi All,

          I was wondering how you interpret negative PAF values from the punafcc command as I have a PAF value of -1.75 and am at a loss to what it means.

          Thanks

          Comment


          • #6
            Originally posted by Roger Newson View Post
            Thanks as always to Kit Baum, a new version of the punafcc package is now available for download from SSC. In Stata, use the ssc command to do this, or adoupdate if you already have an old version of punafcc.

            The punafcc package is described as below on my website. The new version adds the ability to calculate the correct population unattributable and attributable fractions for survival data after fitting a competing risks regression using stccreg, as well as after fitting a Cox regression using stcox. I would like to thank Maryam Darvishian of the University of British Columbia in Canada for suggesting this improvement. I would also like to thank Isabel Canette of StataCorp for passing the news to the developers when I reported a bug in margins that I discovered while developing this new version (reported to Stata TechSupport on 09 Decenber 2016), and the StataCorp developers for fixing this bug in the update of Stata Version 14.2 dated 19 December 2016.

            Best wishes

            Roger

            -----------------------------------------------------------------------------------------
            package punafcc from http://www.imperial.ac.uk/nhli/r.newson/stata14
            -----------------------------------------------------------------------------------------

            TITLE
            punafcc: Population attributable fractions for case-control and survival studies

            DESCRIPTION/AUTHOR(S)
            punafcc calculates confidence intervals for population attributable
            and unattributable fractions in case-control or survival studies.
            punafcc can be used after an estimation command whose parameters are
            interpreted as log rate ratios, such as logit or logistic for
            case-control data, or stcox for survival data. It estimates the log
            of the mean rate ratio, in cases or deaths, between 2 scenarios, a
            baseline scenario ("Scenario 0") and a fantasy scenario ("Scenario
            1"), in which one or more exposure variables are assumed to be set
            to particular values (typically zero), and any other predictor
            variables in the model are assumed to remain the same. This ratio
            is known as the population unattributable fraction (PUF), and is
            subtracted from 1 to derive the population attributable fraction
            (PAF), defined as the proportion of the cases or deaths attributable
            to living in Scenario 0 instead of Scenario 1.

            Author: Roger Newson
            Distribution-Date: 11january2017
            Stata-Version: 14

            INSTALLATION FILES (click here to install)
            punafcc.ado
            punafcc_p.ado
            punafcc.sthlp
            -----------------------------------------------------------------------------------------
            (click here to return to the previous screen)
            Hi Roger, Thanks for sharing the program. Is there any way to calculate Potential impact fraction using punafcc or other package in Stata?

            Comment


            • #7
              Roger Newson Stephen Jenkins

              Hi Roger and Stephen,
              I would very much appreciate your help.
              May you kindly guide me on which command/syntaxes can I use to obtain the 95% confidence intervals for population attributable fractions when using conditional logistic regression models (across strata).

              I used the PUNAFCC command but obtained "zero" results.

              Those were my syntaxes (in addition I played around the PUNAFCC but all attempts failed probably due to the clogit command):

              [/QUOTE]
              Clogit suicide exposure gender if agegroup==1, group(matchedid) or

              PUNAFCC

              [/QUOTE]

              Comment

              Working...
              X