Announcement

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

  • Narrowing Regress, R down to just Male and just female.

    I have this code I have to run a regression on and I want some advice on what I wrote. When I asked for help I felt like I was being called stupid in a sense.

    reg lnw grade age male drace married birthyear34 birthyear33 /∗
    ∗/ birthyear32 birthyear31 birthyear30 birthyear29 birthyear28 /∗
    ∗/ birthyear27 birthyear26 if classwkr==2 & age>=30 & age<=39, r
    Wage and Salary Workers Ages 40-49:
    reg lnw grade age male drace married birthyear24 birthyear23 /∗
    ∗/ birthyear22 birthyear21 birthyear20 birthyear19 birthyear18 /∗
    ∗/ birthyear17 birthyear16 if classwkr==2 & age>=40 & age<=49, r

    Keep in mind gen male=(sex==1) was stated earlier in my code
    What I did for JUST female is "if classwkr==2 & age>=30 & age<=39 & male==0, r

    and what I was going to do for JUST male was delete male from "reg lnw grade age drace married" and
    move it to "if classwkr==2 & age>=30 & age<=39 & male==1, r"
    (Of course I would do the same for the other group)
    Please let me know if I am doing something wrong.

  • #2
    Your question is a bit vague, so I don't really know what exactly your problem is and what you want help with.

    I will just note that you can either include male as a regressor, or you can put in an if condition for male == 1 or male == 0. You cannot do both.

    If you include male as a regressor, you allow the regression line to have different intercepts for men and women, but force the other regressors to have the same slope for men and women.

    If you condition on male == 1 or male == 0, you allow for all the coefficients (not just intercept, but the slopes for other regressors too) to vary between men and women.

    If this doesn't help you, please specify your problem more clearly. Also, please review the Statalist FAQs. In particular, please enclose your code within CODE delimiters so it is easier to read (use the # button on the edit toolbar).

    Comment

    Working...
    X