Announcement

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

  • label define not showing first value for regression

    Hello,
    First, I hope everyone had/has a happy easter this year !
    I have a problem with my regression.
    I first "grouped" some variables as following for example:
    Code:
    . generate neuro=0 if Neurocitism < mean_neurocitism
    . replace neuro=1 if Neurocitism >= mean_neurocitism
    . label define neuro 0 "low_neuro" 1 "high_neuro"
    . label val neuro neuro
    
    . generate extravert = 0 if Extraversion < mean_extraversion
    . replace extravert = 1 if Extraversion >= mean_extraversion
    . label define extravert 0 "low_extr" 1 "high_extr"
    . label val extravert extravert
    After that I tried to do a regression with interaction effects with:
    Code:
    . regress SWB i.neuro##i.extravert
    The problem is it doesn't show the effects of low_neuro or low_extra
    Code:
    Source | SS df MS Number of obs = 21000
    -------------+------------------------------ F( 3, 20996) = 11.82
    Model | 99.005519 3 33.0018397 Prob > F = 0.0000
    Residual | 58638.5647 20996 2.79284458 R-squared = 0.0017
    -------------+------------------------------ Adj R-squared = 0.0015
    Total | 58737.5702 20999 2.79716035 Root MSE = 1.6712
    
    ---------------------------------------------------------------------------------------
    SWB | Coef. Std. Err. t P>|t| [95% Conf. Interval]
    ----------------------+----------------------------------------------------------------
    neuro |
    high_neuro | -.1988148 .0679501 -2.93 0.003 -.3320022 -.0656275
    |
    extravert |
    high_extr | .1692158 .0672993 2.51 0.012 .037304 .3011277
    |
    neuro#extravert |
    high_neuro#high_extr | .0140056 .0815663 0.17 0.864 -.1458707 .1738819
    |
    _cons | 6.928639 .0515492 134.41 0.000 6.827599 7.02968
    The problem happens to every variable I use, it always excludes the first value, so it probably has to something with . label define or . label val but
    I can't find out what it is.

    I hope someone can (Probably, because I hope it will be a minor problem again) help me with that.
    Thanks a lot in advance and kind regards
    Marcel
    Last edited by Marcel Meyer; 17 Apr 2017, 04:35.

  • #2
    Hello Marcel,

    Welcome to the Stata Forum / Statalist

    Please read the FAQ, particularly on how to shate command and output. Thanks.

    With regards to your question, I believe there is nothing wrong with the output.

    It just presents the coefficient of the level 1 for each categorical variable, compared to the reference level (=0).

    This is something to be expected overall.
    Best regards,

    Marcos

    Comment


    • #3
      Marcel:
      you you re-type -regress- as follows:
      Code:
      regress SWB i.neuro##i.extravert, basel
      you may appreciate what's going on.

      PS: Crossed in the cyberspace with Marcos' helpful reply.
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #4
        Thank you very much, Marcos and Carlo !
        I tried to improve the my topic by putting the relevant information in "[ Code][/ Code]", hope it is now conform to the rules !
        I think I understand what you both mean.
        My problem is that I would like to also show the influence of the level 0 on the dependent variable,
        meaning I'd also like to know the coefficient of "low_neuro" for example. Maybe I explained it wrongly.
        Again, thank you a lot for the fast and understandable help, you're really improving my day !

        Kind regards,
        Marcel

        Comment


        • #5
          Marcel.
          as per dummy-trap (please, see: https://en.wikipedia.org/wiki/Dummy_...le_(statistics) you simply cannot get both coefficients for level 0 and 1.
          You can have only one of them at time, by playing around with the reference category in -i.<whatyoulike>.
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            My problem is that I would like to also show the influence of the level 0 on the dependent variable,
            You can use - margins - and - marginsplot - command for that.
            Best regards,

            Marcos

            Comment


            • #7
              I am really sorry I didn't answer !!!
              Thank you both very much for your help, it was really useful.
              Kind regards,
              Marcel

              Comment

              Working...
              X