Announcement

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

  • "could not calculate numerical derivatives -- discontinuous region with missing values encountered" when I run margin on a variable

    Dear all,
    I ran multivariable GLM (power .6; family igauss) on a cost outcome. The sample is over 46,000. The model ran through. I need to run margin command on a set of variables. I got results for all variables except one. The error message is "could not calculate numerical derivatives -- discontinuous region with missing values encountered". The variable is a binary variable with 37% of sample with a value of 1 and 63% with a value of 0. Do you why that happens and how to address the problem?
    Thank you
    Alex

  • #2
    Do you get the error message if you use the nose option?

    If not, then you can go that route and get the standard errors by bootstrapping a small program that (1) fits the GLM, (2) executes the margins postestimation command for the problematic predictor and (3) individually returns the two elements from the resulting r(table) matrix.

    I assume that your using factor variable notation for the binary predictor.
    Last edited by Joseph Coveney; 07 Oct 2023, 01:17. Reason: separately → individually

    Comment

    Working...
    X