Announcement

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

  • Regression based on the returns of males, while excluding the returns of females and missing values

    Cannot delete the topic but it seems that I found the solution after all.
    Last edited by Victoria Rogers; 24 Oct 2014, 02:58.

  • #2
    The problem with your Male variables is that it is missing when the person is female. This is not what you want. Instead you can do:

    Code:
    gen byte Male = 0 if !missing(gender)
    replace Male = 1 if gender == 0
    regress return risk_premium if Male == 1
    You seem to want to do this separately for different (groups of) dates, but you neither mention this in your question nor does your code really do this. You could look at help statsby or help rolling.
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Victoria:
      I would follow this route:
      Code:
      gen alpha_male3=.
      regress return risk_premium if Male==0
      replace alpha_male3=_b[_cons] if Male==0
      Kind regards,
      Carlo
      Kind regards,
      Carlo
      (Stata 18.0 SE)

      Comment


      • #4
        Thank you for the help. Hopefully you can also help me with a very difficult problem.
        http://www.statalist.org/forums/foru...f-observations

        Comment


        • #5
          Victoria:
          please see my reply at http://www.statalist.org/forums/foru...rvations/page2 #20

          Kind regards,
          Carlo
          Kind regards,
          Carlo
          (Stata 18.0 SE)

          Comment

          Working...
          X