Announcement

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

  • Reldist package - clustered standard errors

    Dear Statalists,

    I have recently discovered the super useful reldist package, and I am currently exploring its functionalities. However, when I tried to add clustered standard errors to the relative pdf computation, Stata returned error. Below you can see the code I used:

    reldist pdf vax_kid_ if children_018==1, by(treatment_herd) bw(0.06) vce(cluster ResponseId)

    groupvar must define two groups
    r(498);

    The groupvar treatment_herd defines two groups, indeed the command gives me no error when run without the clustered standard errors. Any guess about what might be the problem? Thank you in advance!

  • #2
    Dear Laura,

    It is a bit difficult to 'guess' what might be the cause of your problem without the possibility to view (a part of) your data.
    But, my assumption is that to run the command using - vce(cluster personid) in data with repeated observations on individuals (citing the Stata help file) - data in your ResponseId variable should match data in your group variable treatment_herd.
    Could it possibly be so that data in treatment_herd only is matched with either one subgroup or the other subgroup in the group variable treatment_herd?

    And, I totally agree with your enthousiasm for Ben Jann's reldist package.
    He published recently a paper about it in The Stata Journal: Relative distribution analysis in Stata.
    You can find the working paper version here.
    His presentation at the Swiss Stata conference in 2020 about reldist is available here.

    .
    http://publicationslist.org/eric.melse

    Comment


    • #3
      Dear ericmelse,

      Thank you very much for the quick response. I'll try to better explain the situation, maybe there's something I am not seeing: basically I have a sample of parents that answer about an outcome for all the age categories of their children, for this reason I need the clustered standard errors. Either a placebo or a treatment message is randomly shown in the questionnaire to parents, so they are randomised in these two groups. I don't see how the matching problem could possibly arise, and I don't know what else can be wrong..
      Do you have any idea or suggestion? Thank you again, I hope I explained myself clearly!

      Comment


      • #4
        Laura also wrote to me privately and after some back and forth we figured out what was going wrong. The short answer is that reldist did not handle vce(cluster clustvar) correctly (see the list of changes on https://github.com/benjann/reldist for details). I now fixed this and uploaded a corrected version to GitHub. Type

        Code:
        net install reldist, replace from(https://raw.githubusercontent.com/benjann/reldist/master/)
        to install the new version. The update should also become available from the SSC Archive in some time.

        ben

        Comment


        • #5
          Thank you again Ben and all for your help.
          I have another question which is not strictly related to the command: do you know of any published empirical work which used the relative distribution analysis method? If yes, can you maybe share with me the link here? Thanks in advance!

          Comment


          • #6
            (The update is now also available from SSC.)

            I do not maintain a list of publications that make use of the method, but some work is cited in the introduction of the Stata Journal article (https://journals.sagepub.com/doi/pdf...6867X211063147 or, for the working paper, https://ideas.repec.org/p/bss/wpaper/37.html). Maybe look on Google Scholar or so for papers that cite the Handcock/Morris 1999 book.

            Comment


            • #7
              Thanks again, Ben!

              Comment

              Working...
              X