Announcement

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

  • What does the P value refer to in the Margins function (for regression).

    Hi all, Im just looking for some guidance on how to interpret the -margins- command after a regression.

    I am plugging in a fairly simple regression i.e.,

    reg LUF_AD_std i.group_w3##i.c3_c4_prob i.ChildGender c3_childage WB_AD_std

    Then I just wanted to compute the adjusted means of each group for the purposes of viewing the difference between groups visually.

    I notice when I do the -margins- function, it also provides me with a p value for each of my groups - can anyone explain to me what the p value is referring to? Is it referring to whether each respective group is significantly different from the whole sample mean? Or the constant?

    Any help you could provide would be really appreciated.

    Many thanks
    Hannah

  • #2
    Hannah, it might be easier to answer your Q if you showed us the commands and output you are referring to. Use code tags. See pt. 12 of the FAQ.
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    StataNow Version: 19.5 MP (2 processor)

    EMAIL: [email protected]
    WWW: https://www3.nd.edu/~rwilliam

    Comment


    • #3
      You don't say what your margins command was but generally the p-value will be whether the estimate is different than 0. What exactly the estimate represents will depend on exactly what your margins command was. I recommend looking through the manual entry for margins because it's quite a powerful and complex command and it's easy to ask for something that you don't really intend. Richard Williams, also a frequent poster on Statalist, has a number of helpful instructional materials on the margins command available online. You can just Google his name and margins.

      Comment


      • #4
        My response crossed with Richards...I suggest following his expert advice.

        Comment


        • #5
          Thank you Lance and Richard. For some reason I wasnt able to put a screen shot or copy/paste the output into this feed. Too novice of a user I suppose.

          The command is regress LUF_AD_std i.group_w3##i.c3_c4_prob i.ChildGender c3_childage WB_AD_std

          Where LUF_AD_std is my neuroimaging DV, group_w3 is a dichtomous ADHD or no ADHD; and c3_c4_prob is YES/NO whether the children have a Language disorder. The other variables are covariates.


          Then I use:

          Click image for larger version

Name:	Screen Shot 2016-12-05 at 1.29.58 pm.png
Views:	1
Size:	39.0 KB
ID:	1366731


          I thought this was giving me the mean for each group adjusted for my covariates. Which I could plot like so, using marginsplot:

          Click image for larger version

Name:	Screen Shot 2016-12-05 at 1.33.33 pm.png
Views:	1
Size:	85.3 KB
ID:	1366732


          My interpretation of this is that the lines indicate the level of the DV in each group (4 groups: controls with and without language disorders, and ADHD with and without Language disorders).


          I hope this helps to provide a better understanding of my method.

          Many thanks
          Hannah
          Attached Files

          Comment


          • #6
            Please ignore that last image in my last message- it was attached in error.

            Comment


            • #7
              So, for example, in the first row, the p-values is a test of the null hypothesis that the expected value of LUF_AD_std is zero when c3_c4_prob = No and group_w3 = control. THe second row similarly tests the null hypothesis that the expected value of LUF_AD_std is 0 when c3_c4_prob = No and group_w3 = ADHD. And so on. Usually these tests are not of interest; there is usually no reason to think that the expected value of the outcome variable would be zero in any of these conditions, and even if it might, usually nobody cares either way. Tests of null hypotheses are generally most germane when examining marginal effects, not expected values. So most likely you will just want to ignore these p-values.

              All of that said, your -margins- command may not be doing what you think it's doing. Most of the time, the values we want are expected values in the event that every observation in the estimation sample had the values No and Control respectively (or No and ADHD for the second line, etc.) However, because you used the -over()- option, that is not what you got. Instead you got, in the first row, a predicted value calculating using only those observations where group_w3 = Control, and within that restricted set of observations, finding the expected value if everybody had c3_c4_prob = No.

              To get expected means based on the entire estimation sample (which is usually what people want), the command would be:
              Code:
              margins c3_c4_prob#group_w3
              .

              Comment


              • #8
                Aha! Thank you Clyde, that makes more sense now. Yes you're quite right I did not mean to restrict the observations to controls without language disorders only!! Thank you so much for picking that up!

                Comment

                Working...
                X