Announcement

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

  • Error when estimating SUREG with constraints (Stata 18)

    Hello,

    This is my first post on Statalist. I apologize if my question does not fit the etiquette requirements relevant to this forum.

    I am trying to run the following SUR sysem using the sureg command on Stata 18. The dataset consists of 8,645 observations, none of which have missing values. The equation involves 7 coefficient constraints, which are essential identifying restrictions.

    Code:
    global listm lnNm z1 z2 z3 z4  Nm Nf Nc lny lny_z1 lny_z2 lny_z3 lny_z4 lny 
    global listf lnNf z1 z2 z3 z4  Nm Nf Nc lny lny_z1 lny_z2 lny_z3 lny_z4 lny 
    global listc lnNc z1 z2 z3 z4  Nm Nf Nc lny lny_z1 lny_z2 lny_z3 lny_z4 lny 
    
    *** Constraining the coefficients
    constraint 1 [W_m]lny_Nf + [W_f]lny_Nf + [W_c]lny_Nf = 0
    constraint 2 [W_m]lny_Nm + [W_f]lny_Nm + [W_c]lny_Nm = 0
    constraint 3 [W_m]lny_Nc + [W_f]lny_Nc + [W_c]lny_Nc = 0
    constraint 4 [W_m]lny_z1 + [W_f]lny_z1 + [W_c]lny_z1 = 0
    constraint 5 [W_m]lny_z2 + [W_f]lny_z2 + [W_c]lny_z2 = 0
    constraint 6 [W_m]lny_z3 + [W_f]lny_z3 + [W_c]lny_z3 = 0
    constraint 7 [W_m]lny_z4 + [W_f]lny_z4 + [W_c]lny_z4 = 0
    
    sureg (W_m $listm) (W_f $listf) (W_c $listc), constraints(1 2 3 4 5 6 7)
    After running the code, the error message suggests that there are insufficient observations:

    Click image for larger version

Name:	error.JPG
Views:	1
Size:	76.6 KB
ID:	1723836

    I am in a bind now as I have cross checked with the published code that estimates a similar SUR system, which otherwise runs fine. I am not able to place what could be going wrong with what I am doing.

    Request you to help me surmount this problem.

    Thank you



  • #2
    does it run without the constraints?

    Comment


    • #3
      Thanks for responding. I tried running the system without the constraints. Still does not run. Returns the same error message as before. Please suggest where this could be going wrong?
      Last edited by Abhishek Tripathy; 15 Aug 2023, 10:36.

      Comment


      • #4
        Looks like a collinearity issue. A data issue.

        get a correlation matrix on all your Xs.

        or, run the model with one variable and add one at a time until it fails.

        Comment


        • #5
          Thanks for responding. It was indeed a data issue. It seems I had a lot of missing values in one of my dependent variables
          Code:
          W_c
          , due to faulty merging. Now that I have cleaned it up, the equation runs as expected even with constraints. Thank you for drawing my attention to data issues.

          Comment

          Working...
          X