Announcement

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

  • Out-of-sample predictions involving estimated random effects after meqrlogit

    Hi, I have data on baseball games from 1915 - 2016 and am trying to predict the probability of a home win in 2009 based on estimated results from 1915 - 2008.

    I run:

    meqrlogit hwin pfby rec rboby gos hstrk vstrk || team: if year < 2009
    predict ymu, mu

    but the predictions stop after 2008. Same is true if I try predict re*, reffects. On the other hand, predict yxb, xb and predict yfo, fixedonly fill in for the rest of the years. I also tried using estimates save and got the same result.

    From the memeqrlogitpostestimation manual (p.9):

    Technical note

    Out-of-sample predictions are permitted after meqrlogit, but if these predictions involve estimated random effects, the integrity of the estimation data must be preserved. If the estimation data have changed since the model was fit, predict will be unable to obtain predicted random effects that are appropriate for the fitted model and will give an error. Thus to obtain out-of-sample predictions that contain random-effects terms, be sure that the data for these predictions are in observations that augment the estimation data.
    What am I missing? I am making no changes to the estimation data...

  • #2
    I don't think you're doing anything wrong here. I don't have your data, so I can't attempt to replicate your problem. But I've run some similar commands and gotten the out-of-sample predictions with no difficulty. Are you certain you are not modifying the data between your -meqrlogit- and -predict- commands? Can you post a data sample that replicates this problem?

    Added: If you do post back with a data sample, please be sure to use the -dataex- command to do that. Run -ssc install dataex- to get the command, and then run -help dataex- to read the instructions how to use it. Thanks.

    Comment

    Working...
    X