Announcement

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

  • Testing endogeneity in Stata

    Good night! I have a doubt and I would be very thankful if you could help me out.

    I am estimating a model (panel data) where my Y is the stock_index and I have 6 explanatory variables. When testing endogeneity, I needed to use an instrument for that (is the only way, right?). For every endogenous variable, I found an instrument where F>10. This is one example of what I did for each variable:

    reg stock_index pop_dis gdp yield hours_worked gov_trust pop_educ, robust
    reg pop_dis secur gdp yield hours_worked gov_trust pop_educ, robust
    predict vhat6, xb
    reg stock_index vhat6 gdp yield hours_worked gov_trust pop_educ, robust
    test vhat6=0

    My question is, after doing this for every variable, which command do I use to put it all together in a regression? I tested something like: "reg stock_index vhat gdp vhat3 vhat4 vhat5 vhat6, robust" but a friend told me that´s not the correct formula (but also didn´t know the correct one).

    Can you help me, please?
    Last edited by Filipa Silva; 06 Nov 2022, 16:29. Reason: #stata #paneldata #endogeneity

  • #2
    Filipa:
    see examples under -xtivreg- entry, Stata .pdf manual (and keep this thread on this forum, please. Thanks).
    Last edited by Carlo Lazzaro; 15 Nov 2022, 13:07.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      HTML Code:
      https://www.stata.com/support/faqs/statistics/durbin-wu-hausman-test/

      Comment


      • #4
        Code:
        ssc install ivendog

        Comment

        Working...
        X