Announcement

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

  • "margins" does not work for the "cmp" command (simultaneous equations)

    Hello,

    I have a quick question regarding the -margins- after the -cmp- command. I am running a simultaneous equations (ordered probit) model but I cannot get the margins. There are two equations (one for PKG and the other for Trip) in my code. My model looks like this:

    Code:
     cmp (PKG= Age Race_A Race_B Race_H Race_O Smartphone Income_25 Income_50 Income_75 Income_100 Child_1 Child_2) (Trip = PKG# Age Race_A Race_B Race_H Race_O Car_1 Car_2  Emp_Ft Weekend )  [pweight=allwt], indicators($cmp_oprobit $cmp_oprobit )
    I got the model result and it looks okay.

    Mixed-process regression
    Number of obs = 2,160, Wald chi2(21) = 3582.08
    Log pseudolikelihood = -3401.4193 , Prob > chi2 = 0.0000
    Coef. Std. Err. z P>z [95% Conf. Interval]
    PKG
    Age -0.00818 0.002182 -3.75 0 -0.01246 -0.00391
    Race_A 0.003987 0.103061 0.04 0.969 -0.19801 0.205983
    Race_B -0.2102 0.084909 -2.48 0.013 -0.37662 -0.04378
    Race_H -0.08357 0.084729 -0.99 0.324 -0.24964 0.082497
    Race_O -0.51918 0.213183 -2.44 0.015 -0.93701 -0.10135
    Smartphone 0.530897 0.10361 5.12 0 0.327825 0.733969
    Income_25 0.163087 0.104023 1.57 0.117 -0.04079 0.366968
    Income_50 0.393381 0.103228 3.81 0 0.191058 0.595705
    Income_75 0.545501 0.112677 4.84 0 0.324659 0.766344
    Income_100 0.757234 0.110492 6.85 0 0.540674 0.973795
    Child_1 0.090436 0.078244 1.16 0.248 -0.06292 0.243791
    Child_2 0.167188 0.079285 2.11 0.035 0.011792 0.322584
    Trip
    PKG# 0.44458 0.170289 2.61 0.009 0.11082 0.778341
    Age 0.011561 0.004005 2.89 0.004 0.003712 0.01941
    Race_A -0.36778 0.245455 -1.5 0.134 -0.84886 0.113305
    Race_B 0.280395 0.188232 1.49 0.136 -0.08853 0.649323
    Race_H 0.146785 0.16831 0.87 0.383 -0.1831 0.476667
    Race_O -4.02057 0.677218 -5.94 0 -5.34789 -2.69325
    Car_1 4.268134 0.341488 12.5 0 3.598829 4.937439
    Car_2 4.430902 0.331977 13.35 0 3.780238 5.081566
    Emp_Ft -0.27855 0.121284 -2.3 0.022 -0.51626 -0.04084
    Weekend 0.192648 0.134175 1.44 0.151 -0.07033 0.455626
    /cut_1_1 -0.12556 0.166133 -0.76 0.45 -0.45117 0.200054
    /cut_1_2 0.298658 0.163662 1.82 0.068 -0.02211 0.61943
    /cut_1_3 1.25663 0.167456 7.5 0 0.928422 1.584838
    /cut_1_4 1.628837 0.165322 9.85 0 1.304812 1.952862
    /cut_2_1 6.616011 0.130187 50.82 0 6.360849 6.871174
    /atanhrho_12 -0.64896 0.236971 -2.74 0.006 -1.11341 -0.1845
    rho_12 -0.57097 0.159717 -0.80527 -0.18244
    .
    HOWEVER, -margins- does not work well for the second equation. This is the margins for the second question. All values are zeroes.
    margins, dydx(*) predict(eq(#2) pr outcome(#1))
    dy/dx Std. Err. z P>z [95% Conf. Interval]
    Age 0 (omitted)
    Race_A 0 (omitted)
    Race_B 0 (omitted)
    Race_H 0 (omitted)
    Race_O 0 (omitted)
    Smartphone 0 (omitted)
    Income_25 0 (omitted)
    Income_50 0 (omitted)
    Income_75 0 (omitted)
    Income_100 0 (omitted)
    Child_1 0 (omitted)
    Child_2 0 (omitted)
    .
    For the first equation, it works well for every outcome. For instance,
    margins, dydx(*) predict(eq(#1) pr outcome(#1))
    dy/dx Std. Err. z P>z [95% Conf. Interval]
    Age 0.002593 0.00068 3.81 0 0.00126 0.003926
    Race_A -0.00126 0.032646 -0.04 0.969 -0.06525 0.062721
    Race_B 0.066584 0.026922 2.47 0.013 0.013818 0.119351
    Race_H 0.026472 0.026851 0.99 0.324 -0.02615 0.079098
    Race_O 0.16446 0.067394 2.44 0.015 0.03237 0.296549
    Smartphone -0.16817 0.032171 -5.23 0 -0.23123 -0.10512
    Income_25 -0.05166 0.03294 -1.57 0.117 -0.11622 0.012899
    Income_50 -0.12461 0.032573 -3.83 0 -0.18845 -0.06077
    Income_75 -0.1728 0.035361 -4.89 0 -0.2421 -0.10349
    Income_100 -0.23987 0.034391 -6.97 0 -0.30727 -0.17246
    Child_1 -0.02865 0.024763 -1.16 0.247 -0.07718 0.019888
    Child_2 -0.05296 0.025014 -2.12 0.034 -0.10199 -0.00393
    Car_1 0 (omitted)
    Car_2 0 (omitted)
    Emp_Ft 0 (omitted)
    Weekend 0 (omitted)
    .
    Why am I getting all "zero"s in the marginal effects for the second equation?

    I would really appreciate your help.

    Sincerely,
    Last edited by Woo Kim; 09 Apr 2020, 16:19.

  • #2
    Welcome to Stata list. You will increase your chances of useful answer by following the FAQ on asking questions-provide Stata code in code delimiters, readable Stata output, and sample data using dataex. It is also a good idea to simplify your model and posting as much as you can while still reflecting the problem. Shorter posts are much more likely to get responses.

    Does changing the order in which things appear in the CMP command change which equation has problems? If so, you might be able to get all the margins simply by changing the order of the equations. However, if this doesn't work, then you may need to contact the program's author. With user written programs, only the authors of the programs have often spent the time to really understand the programming details.

    Comment


    • #3
      Read the cmp help file and try using " resultsform(structural | reduced) " in the code

      here's the example in the cmp help file

      cmp (price: priceO = quantity# pcompete income) (quantity: quantityO = price# praw), ind($cmp_oprobit $cmp_oprobit) nolr qui tech(dfp)
      . cmp, resultsform(reduced)
      . margins, dydx(praw) predict(outcome(3) eq(quantity) pr)

      Comment

      Working...
      X