Announcement

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

  • Maximum likelihood estimation - invalid name error

    Hello everyone,
    I keep on getting invalid name errors with this code for a maximum likelihood estimation.

    Code:
    program define normal
    version 16.1
    args lnf mu sigma
    quietly replace `lnf'=ln(normd(($ML y1-'mu')/'sigma'))-
    ln('sigma')
    end
    Any idea what it can be?

    Stefano

  • #2
    Replace 'mu' by `mu' and similarly 'sigma' by `sigma'. (Note the difference in the opening single quote.) Also, make sure to not put the ln(`sigma') term on a new line.
    Last edited by Sebastian Kripfganz; 26 Jan 2022, 05:26.
    https://www.kripfganz.de/stata/

    Comment


    • #3
      Thank you very much!

      Comment

      Working...
      X