Announcement

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

  • weighting in gsem

    I estimate the following model

    Code:
    irrigation_dummy = croptype_dummy + other variables
    croptype_dummy = irrigation_dummy + other variables
    • irrigation_dummy has 2 categories (0 and 1)
    • croptype_dummy has multiple categories (1, 2, 3 ...)
    In STATA I type
    Code:
    gsem (irrigation_dummy0 <- ts1 ts2 ts3 ts4 P1[newid]@1  , logit)(croptype_dummy <- ts1 ts2 ts3 ts4    P1[newid]@1 , mlogit) [pweight=SYS02]
    However, there is something wrong with the weigthing part. The simultaneous system that I estimate should be weighted, but I get the following error message:

    Code:
    Fitting full model:
    
     mopt__check_by_weight():  3204  <tmp>[0,0] found where scalar required
            mopt__validate():     -  function returned error
                _moptimize():     -  function returned error
               Mopt_maxmin():     -  function returned error
                     <istmt>:     -  function returned error
    r(3204);

    The weights tell me how many observations one observation in my sample represent.

    There are no zeros in the weighing variable, so I do not know what is going wrong.

    Any suggestions?

    Thank you very much!

  • #2
    Hello Janka,


    The weights tell me how many observations one observation in my sample represent.
    I gather you should use fweights instead of pweights.
    Best regards,

    Marcos

    Comment


    • #3
      I suspect errors like that show up when Stata hasn't really anticipated this particular problem, so you just get a message that isn't very helpful.

      Like Marcos says, maybe you should be using fweights anyway. If fweights are appropriate but problems persist you could expand the data set (see -help expand-).

      You may want to run the model without weights just to confirm that the weighting is causing the problem.

      You can try simplifying the model, doing one equation at a time.
      -------------------------------------------
      Richard Williams, Notre Dame Dept of Sociology
      Stata Version: 17.0 MP (2 processor)

      EMAIL: [email protected]
      WWW: https://www3.nd.edu/~rwilliam

      Comment

      Working...
      X