Announcement

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

  • Separating regression into males and females

    Hi All,

    I have a logit regression and would like to have results for males and females separately.

    Code:
     logit weight i.finc i.feedingscheme i.gender i.race i.geotype
    I don't want to show gender as a control variable, but to have separate regression results for males and females.

    Please advise.

    Regards
    Nthato


  • #2
    you appear to have 2 choices: (1) eliminate i.gender from your command and add something like "if gender==1" (since you did not provide a data example (use -dataex- please; see the FAQ), I have to guess; then estimate a second regression using "if gender==0" (with same caveat); (2) if you are interested in seeing how one or more of your other variables varies by gender, you can use an interaction of that (those) variable(s) with gender; see
    Code:
    help fvvarlist
    for how to do that

    added in edit: see
    Code:
    help if
    re: the first option above

    Comment


    • #3
      Hi Rich,

      Thanks for the response. I am interested in seeing how all my variables vary by gender.

      My data is as follows:

      ataex

      ----------------------- copy starting from the next line -----------------------
      Code:
      * Example generated by -dataex-. To install: ssc install dataex
      clear
      input long pid byte wave float(child_age age sex race zbmi weight obese equivalized_income finc feedingscheme geo geotype)
      301012 1  . . . . . . .         . . . . .
      301012 2  . . . . . . .         . . . . .
      301012 3  . . . . . . .         . . . . .
      301012 4  . . . . . . .         . . . . .
      301012 5  . . . . . . .         . . . . .
      301013 1  . . . . . . .         . . . . .
      301013 2  . . . . . . .         . . . . .
      301013 3  . . . . . . .         . . . . .
      301013 4  . . . . . . .         . . . . .
      301013 5  . . . . . . .         . . . . .
      301014 1  . . . . . . .         . . . . .
      301014 2  . . . . . . .         . . . . .
      301014 3  . . . . . . .         . . . . .
      301014 4  . . . . . . .         . . . . .
      301014 5  . . . . . . .         . . . . .
      301015 1  . . . . . . .         . . . . .
      301015 2  . . . . . . .         . . . . .
      301015 3  . . . . . . .         . . . . .
      301015 4  . . . . . . .         . . . . .
      301015 5  . . . . . . .         . . . . .
      301016 1  . . . . . . .         . . . . .
      301016 2  . . . . . . .         . . . . .
      301016 3  . . . . . . .         . . . . .
      301016 4  . . . . . . .         . . . . .
      301016 5  . . . . . . .         . . . . .
      301017 1  . . . . . . .         . . . . .
      301017 2  . . . . . . .         . . . . .
      301017 3  . . . . . . .         . . . . .
      301017 4  . . . . . . .         . . . . .
      301017 5  . . . . . . .         . . . . .
      301018 1  . . . . . . .         . . . . .
      301018 2  . . . . . . .         . . . . .
      301018 3  . . . . . . .         . . . . .
      301018 4  . . . . . . .         . . . . .
      301018 5  . . . . . . .         . . . . .
      301019 1  . . . . . . .         . . . . .
      301019 2  . . . . . . .         . . . . .
      301019 3  . . . . . . .         . . . . .
      301019 4  . . . . . . .         . . . . .
      301019 5  . . . . . . .         . . . . .
      301020 1  . . . . . . .         . . . . .
      301020 2  . . . . . . .         . . . . .
      301020 3  . . . . . . .         . . . . .
      301020 4  . . . . . . .         . . . . .
      301020 5  . . . . . . .         . . . . .
      301022 1 17 1 1 1 1 0 0 1464.9565 1 1 2 1
      301022 2  . . . . . . .         . . . . .
      301022 3  . . . . . . .         . . . . .
      301022 4  . . . . . . .         . . . . .
      301022 5  . . . . . . .         . . . . .
      301025 1  . . . . . . .         . . . . .
      301025 2  . . . . . . .         . . . . .
      301025 3  . . . . . . .         . . . . .
      301025 4  . . . . . . .         . . . . .
      301025 5  . . . . . . .         . . . . .
      301026 1  . . . . . . .         . . . . .
      301026 2  . . . . . . .         . . . . .
      301026 3  . . . . . . .         . . . . .
      301026 4  . . . . . . .         . . . . .
      301026 5  . . . . . . .         . . . . .
      301027 1  . . . . . . .         . . . . .
      301027 2  . . . . . . .         . . . . .
      301027 3  . . . . . . .         . . . . .
      301027 4  . . . . . . .         . . . . .
      301027 5  . . . . . . .         . . . . .
      301028 1  . . . . . . .         . . . . .
      301028 2  . . . . . . .         . . . . .
      301028 3  . . . . . . .         . . . . .
      301028 4  . . . . . . .         . . . . .
      301028 5  . . . . . . .         . . . . .
      301029 1  . . . . . . .         . . . . .
      301029 2  . . . . . . .         . . . . .
      301029 3  . . . . . . .         . . . . .
      301029 4  . . . . . . .         . . . . .
      301029 5  . . . . . . .         . . . . .
      301031 1  . . . . . . .         . . . . .
      301031 2  . . . . . . .         . . . . .
      301031 3  . . . . . . .         . . . . .
      301031 4  . . . . . . .         . . . . .
      301031 5  . . . . . . .         . . . . .
      301033 1  . . . . . . .         . . . . .
      301033 2  . . . . . . .         . . . . .
      301033 3  . . . . . . .         . . . . .
      301033 4  . . . . . . .         . . . . .
      301033 5  . . . . . . .         . . . . .
      301034 1  . . . . . . .         . . . . .
      301034 2  . . . . . . .         . . . . .
      301034 3  . . . . . . .         . . . . .
      301034 4  . . . . . . .         . . . . .
      301034 5  . . . . . . .         . . . . .
      301035 1  . . . . . . .         . . . . .
      301035 2  . . . . . . .         . . . . .
      301035 3  . . . . . . .         . . . . .
      301035 4  . . . . . . .         . . . . .
      301035 5  . . . . . . .         . . . . .
      301036 1  . . . . . . .         . . . . .
      301036 2  . . . . . . .         . . . . .
      301036 3  . . . . . . .         . . . . .
      301036 4  . . . . . . .         . . . . .
      301036 5  . . . . . . .         . . . . .
      end
      label values wave df_SAACONTACTS
      label def df_SAACONTACTS 1 "Contact 1", modify
      label def df_SAACONTACTS 2 "Contact 2", modify
      label def df_SAACONTACTS 3 "Contact 3", modify
      label values age age5
      label def age5 1 "Middle_Adolescence", modify
      label values sex sex5
      label def sex5 1 "Female", modify
      label values race race5
      label def race5 1 "White", modify
      label values zbmi zbmi5
      label def zbmi5 1 "Healthy_Weight", modify
      label values obese obese5
      label def obese5 0 "Not_Obese", modify
      label values finc finc5
      label def finc5 1 "100%_299%_PL", modify
      label values feedingscheme feedingscheme5
      label def feedingscheme5 1 "nfscheme", modify
      label values geotype geotype5
      label def geotype5 1 "Urban", modify
      ------------------ copy up to and including the previous line ------------------

      Thanks
      Nthato

      Comment


      • #4
        Hi Rich,

        I used the 1st option to look at males and females separately, and it worked perfectly.

        Thanks
        Nthato

        Comment

        Working...
        X