Announcement

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

  • #61
    Dear Joao Santos Silva I have two questions:

    (1) In the help file for IVQREG2 you state that " day* " adds daily fixed effects, however, the output doesn't show the typical output you would expect using " i.day " in a normal regression framework, how should I think about this?

    (2) In a normal IV regression I get an F-statistic, is there an equivalent in the IVQREG case?

    Best,
    William

    Comment


    • #62
      Dear William Skoglund,

      1. I do not see any refernce to fixed effects in the help file; am I missing something? Anyway, there is no variable day in the data, so you cannot use i.day. What you have are 4 variables called day1-day4, and those are the variables included when we regress on day*.
      2. I never found that F statistic useful (you invariable reject the null!), so I did not include it in the command. However, you can use the command test to get it. For example, after the second regression in the help file, you can type
      Code:
      test price day1 day2 day3 day4
      Best wishes,

      Joao

      Comment


      • #63
        Thank you Joao Santos Silva for your swift reply.

        Let me rephrase my second question to clarify: I'm interested in the F-statistic that I usually obtain in a first stage regression using a standard instrumental variables regression.

        Is there a similar measure that I can obtain using the ivqreg2 framework? Using the test function is not possible on the instruments.

        Best,
        William

        Comment


        • #64
          Dear William Skoglund,

          Thanks for clarifying. The estimator is implemented using a GMM approach, and therefore there is no first stage as such. However, you can use the F-test from 2SLS as an informal measure of the relevance of the instruments.

          Best wishes,

          Joao

          Comment


          • #65
            Originally posted by Joao Santos Silva View Post
            Dear Lumeng Liu,

            The method you are using is fine. The p-value of the Wald statistics (t-tests) are reported by default; it that what you are asking about? To use factor variables, you need the xi prefix.

            Best wishes,

            Joao
            Dear Professor Silva,

            Thank you very much for ivqreg2 code.

            I am now using your code as follows: xi: ivqreg2 haz06 z_ihs_refugee_share i.survey_year i.plate, q(0.1 0.25 0.50 0.75) instruments(z_ihs_instrument)

            However, it says the model is not identified. My endogenous variable is z_ihs_refugee_share and my IV is z_ihs_instrument. I do not understand why I get this "The model is not identified" error.

            Can you please help me?

            Thank you in advance.
            Last edited by Cansu Oymak; 17 Jul 2023, 01:28.

            Comment


            • #66
              Originally posted by Joao Santos Silva View Post
              Dear Lumeng Liu,

              The method you are using is fine. The p-value of the Wald statistics (t-tests) are reported by default; it that what you are asking about? To use factor variables, you need the xi prefix.

              Best wishes,

              Joao
              Dear Professor Silva,

              Thank you very much for ivqreg2 code.

              I am now using your code as follows: xi: ivqreg2 haz06 z_ihs_refugee_share i.survey_year i.plate, q(0.1 0.25 0.50 0.75) instruments(z_ihs_instrument)

              However, it says the model is not identified. My endogenous variable is z_ihs_refugee_share and my IV is z_ihs_instrument. I do not understand why I get this "The model is not identified" error.

              Can you please help me?

              Thank you in advance.

              Comment


              • #67
                Dear Cansu Oymak,

                The list of instruments needs to include all exogeneous variables, including the controls.

                Best wishes,

                Joao

                Comment


                • #68
                  Originally posted by Joao Santos Silva View Post
                  Dear Cansu Oymak,

                  The list of instruments needs to include all exogeneous variables, including the controls.

                  Best wishes,

                  Joao
                  Dear Professor Silva,

                  Thank you very much for your reply.

                  When I run this code, it worked: xi: ivqreg2 haz06 z_ihs_refugee_share, q(0.25 0.50 0.75) instruments(z_ihs_instrument i.survey_year i.plate)

                  However, it says that all controls/exgoneous vars are used as instruments. I only have one IV which is z_ihs_instrument. Is there a mistake I am doing?

                  Thank you so much.

                  haz06 = dep var
                  z_ihs_refugee_share = endogenous var
                  z_ihs_instrument=instrument
                  Click image for larger version

Name:	ivqreg2.png
Views:	1
Size:	292.5 KB
ID:	1721081

                  Comment


                  • #69
                    Dear Cansu Oymak,

                    I think that there is a problem with terminology here: you may have just one excluded instrument, but the control variables are instruments for themselves, so you actually have many instruments. The problem you have is that you only included the controls in the list of instruments whereas they should also be included as regressors.

                    Best wishes,

                    Joao.

                    Comment


                    • #70

                      Dear Prof. Joao Santos Silva,

                      I’m running the MMQR linear heteroscedastic model with two endogenous regressor (wind_gw and solar_gw in the code), one exogenous regressor (estlink_gw) and two interaction terms (wind_estlink and solar_estlink). For the endogenous regressors and interaction terms, I use two instruments, here speed3 and irrad. Control variables are introduced.

                      I separated the models in two to ease my machine to run the code in an acceptable time.
                      Model 1 (hereafter) runs smoothly. On the other hand, model 2 never shows any results and runs forever. As you’ve previously mentioned, I tried the option “mu” and tried multiple scales for the regressors. To compare the two models, you can see the summary statistics of the variables that change across models. To my mind, they have more or less similar order of magnitude.

                      After some attempts, dividing the interaction terms and the instrument by 10, 100, 1000, I came to the conclusion that solar_estlink interaction term might be the problem. Variables in model 2 have more zeros than in model one; might this influence the results? At this point I'm stuck. Do you have a rule of thumb or a hint to suggest to make the model deliver the results?

                      Many thanks for your time.

                      Code:
                      […]
                      *model 1
                      
                      ivqreg2 price solar_gw wind_gw wind_estlink estlink_gw [control variables], instrument(irrad speed3 speed_estlink estlink_gw [control variables]) quantile(0.`q') mu
                       
                      summarize wind_gw wind_estlink speed3 speed_estlink
                       
                          Variable |        Obs        Mean    Std. dev.       Min        Max
                      -------------+---------------------------------------------------------
                           wind_gw |     17,544    .088       .089              0       .503
                      wind_estlink |     17,544    34.15      52.77       -112.77    329.87
                            speed3 |     17,544    83.51       118.13        .36   1404.92
                      speed_estl~k |     17,544    31.84     65.52      -108.27   762.99
                       
                      *model 2  
                               
                      ivqreg2 price solar_gw wind_gw solar_estlink estlink_gw [control variables], instrument(irrad speed3 irrad_estlink estlink_gw [control variables]) quantile(0.`q') mu
                       
                      summarize solar_gw solar_estlink irrad irrad_estlink
                       
                          Variable |        Obs        Mean    Std. dev.       Min        Max
                      -------------+---------------------------------------------------------
                          solar_gw |     17,544      .062    .104                  0     .503
                       solar_estlink |     17,544    14.52    37.84         -253.45   254.66
                             irrad |     17,544    120.25   195.015               0      858.6
                      irrad_estl~k |     17,544     31.16    78.55         -300.831   533.47
                      […]

                      Comment


                      • #71
                        Dear Elia Scapini,

                        Please have a look at the help file, and in particular at the gmm optimisation options you can use. Hopefully you can get results by changing these.

                        Best wishes,

                        Joao

                        Comment


                        • #72

                          Dear Joao Santos Silva,

                          Thank you for your help. Finally, it didn’t work much for that specific case, but just for the record I tried to scale the dependent variable too and for some models it worked much better.

                          I would like to try to cluster standard errors. I’m conscious that ivqreg2 has not been built for panel data. Since ivqreg2 does not allow the vce(cluster) option, I tried with bootstrap. However, the iterations stop consistently at three and never go further. Cross-section: hour. Time dimension: days.

                          I use the following code, maybe you could help or suggest something.

                          Code:
                          bootstrap, cluster(hour) seed(123) rep(200): ivqreg2 price_s solar_s wind_s load_s estlink_s lag_p h2-h24 temp, instrument(irrad_s speed3_s load_s estlink_s lag_p h2-h24 temp) ls quickd
                          Many thanks!

                          Comment


                          • #73
                            Dear Elia Scapini,

                            Apologies for the late reply. I have no idea what may be causing the problem, but if you are willing to share your data with me (by email), I am happy to investigate the issue.

                            Best wishes,

                            Joao

                            Comment

                            Working...
                            X