Announcement

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

  • Error message sample may not include multiple panels

    I am trying to use ivregress and ivreg2.
    When I use the option for autocorrelation consistent (bw, hac) I got error messages that the: "sample may not include multiple panels", or "variable NAME not found".
    Some of the variables in my initial dataset were constructed by using a firm identifier variable and fiscal year variable, those variables were later been dropped. Now I am trying to regress by using industry identifier variable and calendar year variable. These two variables and all the other in my dataset were constructed by the collapse command (they now represent an average of all the firms in industry I at year T).
    Those massage come up with or without using the command tsset before ivregress.
    Is it possible that Stata "recall" that some variables were built by using the firm identifier and fiscal year variable?
    I will appreciate any help how to overcome this problem.

    Thanks,
    Netty

  • #2
    Can you provide more details? The command you're using, the actual error message, the versions of Stata and of ivreg2, etc. Also, what is the output of the tsset or xtset command (without arguments)?

    BTW, the last time I looked, ivregress did not support HAC-robust VCEs for panel setups. ivreg2 supports it, though. My guess is that you are getting the error message "variable NAME not found" after estimation with ivreg2 because the data is xtset on a variable that doesn't exist any more. But in the absence of the details requested above that's just a guess.

    Comment


    • #3
      Mark,

      Thank you very much for your quick response and your reediness to help.
      I am using Stata 13.

      After the collapse command I used two options:
      1 – ivregress 2sls dv (endogenous var = var1 var2) list of control variables, vce (hac nw 1)
      2 – ivreg2 dv (endogenous var = var1 var2) list of control variables, robust cluster(Industry var) bw(1)

      In both cases I got the error message: "Variable FIRM IDENTIFIER not found" this variable was drop after the collapse command, because I aggregated my firm-level data into industry-level in order to run the IV regression. The firm identifier variable and fiscal year variable were used to construct some of the variables in the dataset.

      After I got the above message I use the tsset command:
      Tsset: var# (industry identifier) var# (calendar year)
      The output is:
      panel variable: naicsa4 (unbalanced)
      time variable: year, 2009 to 2011, but with gaps
      delta: 1 unit

      Then I rerun the IV regression (both ivregress and ivreg2) and got the next error message: "sample may not include multiple panels"
      By the way, I got the last message after using ivactest and "abar" commands.

      Thank again in advance.

      Comment


      • #4
        You should indeed get error 459 "sample may not include multiple panels" with ivregress, because as I mentioned already, it doesn't support HAC for panel data. However, ivreg2 does support HAC in this setup, so you shouldn't get this error when you use ivreg2.

        But I see what looks like a more basic problem. The HAC covariance estimator relies on the number of time periods going off to infinity. It looks like you have only 3 years of data, and sometimes only 2 years. Using HAC is probably not the way to go. You should perhaps just cluster on industry, which gives you a VCE that's robust to within-panel serial correlation. That may be what you want anyway.

        Comment


        • #5
          Mark,
          Thank you for your answer, given your explanation I understood what you was the problem.
          Now it works correctly.
          I appreciate your assistance!

          Comment


          • #6
            Dear Netty

            ​I wanted to ask you about this error message
            Code:
              sample may not include multiple panels
            r(459);
            which I see you were faced to this problem.

            I am trying to test my data for seasonality, and once I am trying to run any tests, I am getting that error message. My data consists from 5 quarters over 2 years, I high appreciate if you could help me in this problem

            Thank you

            Comment


            • #7
              Hi everyone,

              First-time user here! Currently an undergrad student and I desperately need help for the ivregress and ivreg2. I'm currently estimating a simultaneous equation system with 2SLS and GMM and would need help in inputing the right commands in stata. Here's a brief description of my variables

              Endogenous: GDP, KAP, EM, HK, OPEN, FDI, SAV, WEALTH
              Exogenous: interest, tax, inflat, gtran, gee, rmb, wage, pc
              Instruments: lagged endogenous variables + lagged and current exogenous variables

              System of equations
              1. GDP KAP EM HK FDI SAV gtran
              2. KAP GDP OPEN FDI SAV interest tax
              3. EM GDP HK OPEN FDI interest inflat
              4. HK GDP FDI SAV interest gtran gee
              5. OPEN GDP KAP EM HK intrest rmb inflat pc
              6. FDI GDP HK OPEN rmb wage tax pc
              7. SAV GDP EM WEALTH interest tax pc
              8. WEALTH GDP OPEN SAV interest tax
              I tried it with ivreg2, seem to keep getting an error

              . ivreg2 d1lgdp (d1lkap d1lem d1lhk d1lfdi d1lsav = d1lgtran d1lkap_1 d1lem_1 d1lhk_1 d1lfdi_1 d1lsav_1 d1lgtran_1
              > ), first
              struct ms_vcvorthog undefined
              (817 lines skipped)
              (error occurred while loading ivreg2.ado)
              r(3000);

              I truly hope you can help me out. Would appreciate any bit of advice! thank you!

              Grateful,
              Sam

              Comment

              Working...
              X