Announcement

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

  • #16
    Thank you very much Joro Kolev for your explanation.

    Originally posted by
    gen WQhigh = WQ=="high"
    gen WQmedium = WQ=="medium"

    ivreg2 diarrhea (WQhigh WQmedium= mean_elevation c.max_tem#i.Interview_month) X2 X3 dist_sanitation_coverage i.province i.year, cluster (village)
    [/CODE
    .
    When i run 2SLS with these WQhigh WQmedium variables , some WQ variables are omitted. The results also changed totally.
    Robust
    chdiarrhea Coef. Std. Err. z P>z [95% Conf. Interval]
    WQhigh 0 (omitted)
    WQmedium -.4347796 .0715258 -6.08 0.000 -.5749676 -.2945916
    WQconformity 0 (omitted)
    child_agemo -.0144554 .0034439 -4.20 0.000 -.0212053 -.0077055
    How can i use this explanatory variable in other way.

    Comment


    • #17
      Originally posted by Chanda Moon View Post
      Thank you very much Joro Kolev for your explanation.



      When i run 2SLS with these WQhigh WQmedium variables , some WQ variables are omitted. The results also changed totally.
      Robust
      chdiarrhea Coef. Std. Err. z P>z [95% Conf. Interval]
      WQhigh 0 (omitted)
      WQmedium -.4347796 .0715258 -6.08 0.000 -.5749676 -.2945916
      WQconformity 0 (omitted)
      child_agemo -.0144554 .0034439 -4.20 0.000 -.0212053 -.0077055
      How can i use this explanatory variable in other way.
      MY code for WQ variable is:

      gen WQ=.
      replace WQ=1 if WQ26 < 1
      replace WQ=2 if WQ26 >=1 & WQ26 <=10
      replace WQ=3 if WQ26 > 10

      Comment


      • #18
        Originally posted by Chanda Moon View Post
        Thank you everyone for the nice guidence.
        I have similar confusion and need help.

        I am exploring causal effect of household water quality and child health indicators (ARI, diarrhea, malnutrition- where diarrhea and Infant mortality are binary and malnutrition is continuous outcomes). Water quality is main regression and categorical variable based on bacterial contamination (low, medium, and high risk). 2 Instruments, one is continuous at district level elevation & 2nd is (interaction) max average temperature X interview month.

        My code is as follows:

        ivreg2 diarrhea (WQ= mean_elevation c.max_tem#i.Interview_month) X2 X3 dist_sanitation_coverage i.province i.year, cluster (village)

        similar code for other outcomes. Does this model is correct using 2SLS model
        I coded the WQ explanatory variable in following way:

        gen WQ=.
        replace WQ =1 if WQ26 < 1
        replace WQ =2 if WQ26 >=1 & WQ26 <=10
        replace WQ =3 if WQ26 > 10

        Comment


        • #19
          And hence people around here say that you should post a sample using -dataex-, because nobody short of mindreaders (of whom there are not many around here) can know what your variables are.

          Also start your own thread the next time. I see how your question is related to the original problem OP posted, but yet your question is on linear analysis.

          Think if you generate your dummies the following way, it will solve your problem:

          Code:
          gen WQmedium = WQ == 2
          gen WQhigh = WQ == 3
          and then

          Code:
          ivreg2 diarrhea (WQhigh WQmedium= mean_elevation c.max_tem#i.Interview_month) X2 X3 dist_sanitation_coverage i.province i.year, cluster (village)

          Comment


          • #20
            Originally posted by Mustafa Coban View Post
            Hi,

            there is a new package rbiprobit that handles recursive bivariate probit models

            Code:
            ssc install rbiprobit
            So, if your outcome variable is binary and your endogenous treatment variable is also binary, you can use rbiprobit to get coefficient estimates, to compute marginal effects and to compute treatment effects.

            Here, a short example for computation of the average treatment effect and the marginal effects of x2 on the joint probability p11
            Code:
            rbiprobit (y1 = x1 x2), endog(y2 = x2 x3)
            rbiprobit tmeffects, tmeff(ate)
            rbiprobit margdec, dydx(x2) predict(p11) effect(total)
            While biprobit will give you the correct coefficient estimates if you fit a recursive model, it won't give you the correct predictions, treatment effects and marginal effects.
            Thank you everyone.
            Mustafa sir, I want to estimate marginal effect after rbiprobit but state cannot run the above commands. Do I need to install some code. I installed from SSC rbiprobit.

            Thank you

            Comment


            • #21
              Hi,

              if you provide your Stata code and the error output, I could take a closer look at the problem.

              Comment


              • #22
                Thank you Mustafa coban.

                I am using cross-sectional data 03 3 countries.

                Y= diarrhea = binary
                X= water_source= binary
                Z1, Z2= continuous instruments (z1= village mean IV, Z2= elevation (district mean)) By using these instruments my F-stat is around 250 (without controls) and 180(after all controls) with 2SLS.(is that OK?)

                2ndly my coefficient for diarrhea with OLS is (0.0114 SD= .0082819 t= 1.69 ). 2SLS coefficient is higher . Is this OK or anything stage with IV.? However, taking log of water(X) OLS and IV estimates are not much different.

                I am using 2SLS and I compared with probit model (I got almost similar results with margins of biprobit).

                i use following code

                ivreg2 chdiarrhea (water = WUA elevation ) child_gender child_age hh_sex hh_edu mo_edu hh_size r handwash imp_sanitation livestock floor_material rural i.country i.HH5Y [pweight= wqhweight], cluster (village)


                Number of obs = 12387
                F( 30, 12356) = 19.54
                Prob > F = 0.0000
                Centered R2 = 0.0521
                Uncentered R2 = 0.2126

                Robust
                chdiarrhea Coef. Std. Err. z P>z [95% Conf. Interval]

                water .1190519 .033752 3.53 0.000 .0528991 .1852046

                for biprobit code
                biprobit (chdiarrhea water child_gender child_age hh_sex hh_edu mo_edu hh_size r handwash imp_sanitation livestock floor_material rural i.country i.HH5Y)(water WUA elevation child_gender child_age hh_sex hh_edu mo_edu hh_size r handwash imp_sanitation livestock floor_material rural i.country i.HH5Y) [pweight= wqhweight], cluster(village)

                . margins, dydx(water) predict(pmarg1) force
                (note: prediction is a function of possibly stochastic quantities other than e(b))

                Average marginal effects Number of obs = 12,387
                Model VCE : Robust

                Expression : Pr(chdiarrhea=1), predict(pmarg1)
                dy/dx w.r.t. : hh_ecoli

                ------------------------------------------------------------------------------
                | Delta-method
                | dy/dx Std. Err. z P>|z| [95% Conf. Interval]
                -------------+----------------------------------------------------------------
                water | .0886758 .0339143 2.61 0.009 .022205 .1551466
                ------------------------------------------------------------------------------


                code with LOG of water (endogenous variable taking as continuous)


                Robust
                chdiarrhea Coef. Std. Err. z P>z [95% Conf. Interval]

                water .022382 .0062158 3.60 0.000 .0101993 .0345648

                I would be thankful if I can get answer of my confusions.


                Comment


                • #23
                  I'm sorry but I don't fully understand your approach. If you're treatment variable water binary, I don't see why you should take the logarithm of this binary variable. Usually, I would recommend to estimate the model employing rbiprobit and computing the ATE or ATET using rbiprobit tmeffects. After that you can test your IVs using ivreg2.

                  Comment


                  • #24
                    Thank you.
                    In above model i used ivreg2 and biprobit foe binary dependent and independent variables. but rbiprobit i have issue to run margins and tmeffects for your mentioned codes

                    Code:
                    rbiprobit (y1 = x1 x2), endog(y2 = x2 x3) rbiprobit tmeffects, tmeff(ate) rbiprobit margdec, dydx(x2) predict(p11) effect(total)

                    Comment


                    • #25
                      Hi,

                      that's interesting. Using the example from rbiprobit help-file the postestimation commands work from Stata 15 on. Do you use an older Version of Stata?
                      If you post your full Stata syntax and Statav output, I could get a better understanding of your model and may find a solution to your problem. See the FAQ for posting syntax and outputs.

                      Mustafa

                      Comment


                      • #26
                        Thank you for the clarification. Yes , i am using Stata/MP 14.0. My state syntex is

                        code:
                        rbiprobit chdiarrhea = child_male hh_sex hh_edu mo_edu wom_age hh_size tubwell_motr_hndpump flush_toilet treat_wtr handwash livestock i.region, endog(hh_ecoli vil_sc_ecoli _slop_mean child_male hh_sex hh_edu mo_edu wom_age hh_size tubwell_motr_hndpump flush_toilet treat_wtr handwash livestock internet motorcycle i.region i.HH5Y), cluster(cluster)
                        Recursive Bivariate Probit Regression Number of obs = 14,660
                        Wald chi2(121) = 3289.71
                        Log likelihood = -11670.289 Prob > chi2 = 0.0000
                        Coef. Std. Err. z P>z [95% Conf. Interval]
                        chdiarrhea
                        1.hh_ecoli .2481072 .1093937 2.27 0.023 .0336994 .462515
                        child_male -.0094664 .0256462 -0.37 0.712 -.0597321 .0407993
                        hh_sex -.0639527 .0474521 -1.35 0.178 -.1569571 .0290517
                        hh_edu .0399872 .0286003 1.40 0.162 -.0160685 .0960428
                        for tmeffects
                        rho -.1326043 .0667393 -.2604003 -.000242
                        Wald test of rho=0: chi2(1) = 3.85543 Prob > chi2 = 0.0496
                        . rbiprobit tmeffects, tmeff(ate)
                        r(198);
                        I get this error. Do I need to install any package?


                        Comment


                        • #27
                          Hi,

                          unfortunately, rbiprobit postestimation commands don't work with version 14. You need at least Stata version 15.

                          Comment


                          • #28
                            Thank you Mustafa Coban

                            Comment


                            • #29
                              Hello Mustafa Coba, I'm using your stata code for my regression. I'm trying to find the effect of my control variables on my dependent variable but the code just throws the main regressor ATEs. If you could help me please to see the effect of each regressor. Thank you.

                              Comment

                              Working...
                              X