Announcement

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

  • Specifying class for margins prediction after fmm

    According to the documentation for fmm postestimation, the margins command can predict latent class probabilities for any class:
    Syntax for margins
    ...
    classpr defaults to the first latent class if option class() is not specified.

    However, if I try to specify a class, I get an error:

    Code:
    use https://www.stata-press.com/data/r16/mus03sub
    quietly fmm 3, lcprob(totchr): regress lmedexp income c.age##c.age totchr i.sex
    margins, predict(classpr) class(2)
    
    option class() not allowed
    I would be grateful if someone could tell me what I am doing wrong.

    Thanks

  • #2
    Answering my own question here, but in case someone else stumbles upon the same problem, the correct syntax is

    Code:
    margins, predict(classpr class(2))

    Comment

    Working...
    X