Announcement

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

  • In stata how to test gender differences to see which is more responsive to treatment?

    I have a independent variable and Treatment: Father's education and Mother's Education (Binary)
    dependent variable: Child education (Binary)

    I am trying to use LPM to test for gender differences to see if Men's education is more affected from Father's education or Women's education is more affected from Father's education

    Would anyone be able to give me a help on this?

  • #2
    Well, you also need to have a variable that identifies the sex of the child. Assuming you have such a variable, let's call it sex, the model would look like this:

    Code:
    regress child_education i.sex##i..father_education
    margins sex#father_education
    The difference in effect of father_education on child_education between boys and girls will be estimated by the coefficient of the sex#father_education interaction term in the regression output. The -margins- output will show you the predicted probabilities of child_education in each combination of sex and father_education.

    Comment


    • #3
      Thank you so much for the response....

      May I know how to interpret when I coded the

      Code:
      Code:
      Code:
      regress university i.male i.fedu i.fedu_male
      
      margins fedu_male
      
      fedu_male is interaction term fedu*male
      and university is whether or not sample graduated university.

      there is 0 and 1 with delta method

      0 having margin of .2162936 and 1 having margin of .2058347

      Comment


      • #4
        No, you can't do that. -margins- will not know that your variable i.fedu_male is the interacation between male and fedu, so the results you got from -margins- are nonsense.

        YOu have to do it the way I coded it:

        Code:
        regress university i.male##i.fedu
        margins fedu#male
        DO NOT code your own interaction term. The code I have shown you will do that automatically for you, and -margins- will know then know what it means.

        You need to familiarize yourself with Stata's factor variable notation. See -help fvvarlist- and the associated manual section.

        Comment


        • #5
          Originally posted by Clyde Schechter View Post
          No, you can't do that. -margins- will not know that your variable i.fedu_male is the interacation between male and fedu, so the results you got from -margins- are nonsense.

          YOu have to do it the way I coded it:

          Code:
          regress university i.male##i.fedu
          margins fedu#male
          DO NOT code your own interaction term. The code I have shown you will do that automatically for you, and -margins- will know then know what it means.

          You need to familiarize yourself with Stata's factor variable notation. See -help fvvarlist- and the associated manual section.

          Thank you sir, I understand....May I know how to interpret Margin Section? I have used linear probability model. All the t statistics are significant.

          Comment


          • #6
            It would have been helpful to both of us if you had posted your output. That way I wouldn't have had to make up some fake data to generate example output, and you would have had the advantage of getting an explanation that was directly relevant to your results. That said, here is an example of what the -margins- output would look like.

            Code:
            . margins fedu#male
            
            Adjusted predictions                            Number of obs     =        100
            Model VCE    : OLS
            
            Expression   : Linear prediction, predict()
            
            ------------------------------------------------------------------------------
                         |            Delta-method
                         |     Margin   Std. Err.      t    P>|t|     [95% Conf. Interval]
            -------------+----------------------------------------------------------------
               fedu#male |
                    0 0  |        .36   .0903696     3.98   0.000     .1806177    .5393823
                    0 1  |        .16   .0903696     1.77   0.080    -.0193823    .3393823
                    1 0  |        .32   .0903696     3.54   0.001     .1406177    .4993823
                    1 1  |        .28   .0903696     3.10   0.003     .1006177    .4593823
            ------------------------------------------------------------------------------
            So, this would mean that the predicted probability of university is 0.36 when fedu = 0 and male = 0; it is 0.16 when fedu = 0 and male == 1, etc.

            The p-values in the -margins- output are tests of the hypothesis that the predicted probability in the corresponding group is zero. Generally speaking that's not a meaningful null hypothesis. So the p-values in the -margins- output should be disregarded unless you had a seemingly bizarre prior hypothesis that nobody in that group would have university = 1. If you are interested in these predicted probabilities, I would present them as their expected values (Margin column in the output) and their 95% confidence intervals.

            As for the original goal of deciding whether males and females are differently responsive (in terms of university) to fedu, the test of that is not in the -margins- output but in the regression output:

            Code:
            . regress university i.male##i.fedu
            
                  Source |       SS           df       MS      Number of obs   =       100
            -------------+----------------------------------   F(3, 96)        =      0.91
                   Model |         .56         3  .186666667   Prob > F        =    0.4371
                Residual |        19.6        96  .204166667   R-squared       =    0.0278
            -------------+----------------------------------   Adj R-squared   =   -0.0026
                   Total |       20.16        99  .203636364   Root MSE        =    .45185
            
            ------------------------------------------------------------------------------
              university |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
            -------------+----------------------------------------------------------------
                  1.male |        -.2   .1278019    -1.56   0.121    -.4536848    .0536848
                  1.fedu |       -.04   .1278019    -0.31   0.755    -.2936848    .2136848
                         |
               male#fedu |
                    1 1  |        .16   .1807392     0.89   0.378    -.1987645    .5187645
                         |
                   _cons |        .36   .0903696     3.98   0.000     .1806177    .5393823
            ------------------------------------------------------------------------------
            I have put the relevant row of the table in bold face. The difference in differences is 0.16, with a 95% CI of (0.199... to 0.519...) and a pvalue of 0.378.

            Comment


            • #7
              Originally posted by Clyde Schechter View Post
              It would have been helpful to both of us if you had posted your output. That way I wouldn't have had to make up some fake data to generate example output, and you would have had the advantage of getting an explanation that was directly relevant to your results. That said, here is an example of what the -margins- output would look like.

              Code:
              . margins fedu#male
              
              Adjusted predictions Number of obs = 100
              Model VCE : OLS
              
              Expression : Linear prediction, predict()
              
              ------------------------------------------------------------------------------
              | Delta-method
              | Margin Std. Err. t P>|t| [95% Conf. Interval]
              -------------+----------------------------------------------------------------
              fedu#male |
              0 0 | .36 .0903696 3.98 0.000 .1806177 .5393823
              0 1 | .16 .0903696 1.77 0.080 -.0193823 .3393823
              1 0 | .32 .0903696 3.54 0.001 .1406177 .4993823
              1 1 | .28 .0903696 3.10 0.003 .1006177 .4593823
              ------------------------------------------------------------------------------
              So, this would mean that the predicted probability of university is 0.36 when fedu = 0 and male = 0; it is 0.16 when fedu = 0 and male == 1, etc.

              The p-values in the -margins- output are tests of the hypothesis that the predicted probability in the corresponding group is zero. Generally speaking that's not a meaningful null hypothesis. So the p-values in the -margins- output should be disregarded unless you had a seemingly bizarre prior hypothesis that nobody in that group would have university = 1. If you are interested in these predicted probabilities, I would present them as their expected values (Margin column in the output) and their 95% confidence intervals.

              As for the original goal of deciding whether males and females are differently responsive (in terms of university) to fedu, the test of that is not in the -margins- output but in the regression output:

              Code:
              . regress university i.male##i.fedu
              
              Source | SS df MS Number of obs = 100
              -------------+---------------------------------- F(3, 96) = 0.91
              Model | .56 3 .186666667 Prob > F = 0.4371
              Residual | 19.6 96 .204166667 R-squared = 0.0278
              -------------+---------------------------------- Adj R-squared = -0.0026
              Total | 20.16 99 .203636364 Root MSE = .45185
              
              ------------------------------------------------------------------------------
              university | Coef. Std. Err. t P>|t| [95% Conf. Interval]
              -------------+----------------------------------------------------------------
              1.male | -.2 .1278019 -1.56 0.121 -.4536848 .0536848
              1.fedu | -.04 .1278019 -0.31 0.755 -.2936848 .2136848
              |
               male#fedu |
              1 1 | .16 .1807392 0.89 0.378 -.1987645 .5187645
              |
              _cons | .36 .0903696 3.98 0.000 .1806177 .5393823
              ------------------------------------------------------------------------------
              I have put the relevant row of the table in bold face. The difference in differences is 0.16, with a 95% CI of (0.199... to 0.519...) and a pvalue of 0.378.


              Thank you sir I really appreciate it. Yes, I will post the output if I require help.

              Comment


              • #8
                Originally posted by Clyde Schechter View Post
                It would have been helpful to both of us if you had posted your output. That way I wouldn't have had to make up some fake data to generate example output, and you would have had the advantage of getting an explanation that was directly relevant to your results. That said, here is an example of what the -margins- output would look like.

                Code:
                . margins fedu#male
                
                Adjusted predictions Number of obs = 100
                Model VCE : OLS
                
                Expression : Linear prediction, predict()
                
                ------------------------------------------------------------------------------
                | Delta-method
                | Margin Std. Err. t P>|t| [95% Conf. Interval]
                -------------+----------------------------------------------------------------
                fedu#male |
                0 0 | .36 .0903696 3.98 0.000 .1806177 .5393823
                0 1 | .16 .0903696 1.77 0.080 -.0193823 .3393823
                1 0 | .32 .0903696 3.54 0.001 .1406177 .4993823
                1 1 | .28 .0903696 3.10 0.003 .1006177 .4593823
                ------------------------------------------------------------------------------
                So, this would mean that the predicted probability of university is 0.36 when fedu = 0 and male = 0; it is 0.16 when fedu = 0 and male == 1, etc.

                The p-values in the -margins- output are tests of the hypothesis that the predicted probability in the corresponding group is zero. Generally speaking that's not a meaningful null hypothesis. So the p-values in the -margins- output should be disregarded unless you had a seemingly bizarre prior hypothesis that nobody in that group would have university = 1. If you are interested in these predicted probabilities, I would present them as their expected values (Margin column in the output) and their 95% confidence intervals.

                As for the original goal of deciding whether males and females are differently responsive (in terms of university) to fedu, the test of that is not in the -margins- output but in the regression output:

                Code:
                . regress university i.male##i.fedu
                
                Source | SS df MS Number of obs = 100
                -------------+---------------------------------- F(3, 96) = 0.91
                Model | .56 3 .186666667 Prob > F = 0.4371
                Residual | 19.6 96 .204166667 R-squared = 0.0278
                -------------+---------------------------------- Adj R-squared = -0.0026
                Total | 20.16 99 .203636364 Root MSE = .45185
                
                ------------------------------------------------------------------------------
                university | Coef. Std. Err. t P>|t| [95% Conf. Interval]
                -------------+----------------------------------------------------------------
                1.male | -.2 .1278019 -1.56 0.121 -.4536848 .0536848
                1.fedu | -.04 .1278019 -0.31 0.755 -.2936848 .2136848
                |
                male#fedu |
                1 1 | .16 .1807392 0.89 0.378 -.1987645 .5187645
                |
                _cons | .36 .0903696 3.98 0.000 .1806177 .5393823
                ------------------------------------------------------------------------------
                I have put the relevant row of the table in bold face. The difference in differences is 0.16, with a 95% CI of (0.199... to 0.519...) and a pvalue of 0.378.


                Sir may I get more clarification in the difference in differences being 0.16.

                Comment


                • #9
                  So look at the bold-faced line in the regression output table. (It's displayed most neatly in #4--so look there.) Under the Coef. column it says 0.16. This is the difference between the effect of fedu on male university outcomes and the effect of fedu on female university outcomes. You can also see it this way from the -margins- output:

                  Probability of university for males without fedu is 0.16 (a coincidence)
                  Probability of university for females without fedu is 0.36.
                  The male female difference without fedu is 0.16 - 0.36 = -0.20

                  Probability of university for males with fedu is 0.28
                  Probability of university for females with fedu is 0.32
                  The male female difference without fedu is 0.28 - 0.32 = -0.04

                  The difference between the male-female difference with fedu and the male-female difference without fedu (the difference in differences) is -0.04 - (-0.20) = 0.16 which is, not coincidentally, the coefficient of the male#fedu interacton term in the regression output.

                  Comment

                  Working...
                  X