Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: missing value problem in ml estimation

From   Lian Jian <>
Subject   Re: st: missing value problem in ml estimation
Date   Sat, 7 Jan 2006 09:38:34 -0500

Thank you for your reply, Maarten.

I did end up using  the "missing" option in -ml model and it worked
fine. Although I can submit my paper using this "missing" option, I
still feel troubled not knowing the answer of my following question.

What troubles me is that when I did not know the existence of this
"missing" option, I recoded the missing values from "." to 999999999
using "recode ts1 miss=999999999", thinking that it wouldn't matter.
Theoretically, it shouldn't matter because ts1 is only used when y ==
1. When y == 0, the value of ts1 does not enter the likelihood
function. I have made sure whenever y==1, ts1 has a valid value. And
whenever y==0, ts1 is missing.  What troubles me is that when the
missing values of ts1 are coded as 2 or 999999999, it gives me
different estimation results.

Could it be that when ml calculates the gradient vector, it uses the
values of the variables that do not enter the likelihood function?

Thanks again,

On 1/7/06, Maarten buis <> wrote:
> Dear Lian,
> Am I understanding you correctly that you have missing values which you have given numerical
> values like 2 or 99999999? How did you tell Stata that a 2 or a 9999999 means missing? The
> standard code for missing in Stata is ".", if you want more than one missing code you could use
> ".a" till ".z". My guess is that Stata did not recognize your missing codes as missing and treated
> them as real values. see -help missing- for more information on missing observations in Stata.
> -help ml- tells you that the "missing" option in -ml model- "specifies that observations
> containing variables with missing values are not to be eliminated from the estimation sample",
> which is probably not what you want.
> HTH,
> Maarten
> -----------------------------------------
> Maarten L. Buis
> Department of Social Research Methodology
> Vrije Universiteit Amsterdam
> Boelelaan 1081
> 1081 HV Amsterdam
> The Netherlands
> visiting adress:
> Buitenveldertselaan 3 (Metropolitan), room Z214
> +31 20 5986715
> -----------------------------------------
> Lian Jian wrote:
> > I was using "lf" method to do an ml estimation with my own
> > evaluator (likelihood function). I am using the default
> > modified Newton-Raphson algorithm.  In each of my observation,
> > there are some variables with missing values, but these
> > variables do not appear in my likelihood function. In other
> > words, theoretically these missing values should not matter. I
> > have tried using "missing" option in my model command, which
> > worked fine.
> >
> > However, I also tried coding the missing values as different
> > numerical numbers, like 2 or 999999999. Surprisingly, I have
> > gotten different answers by coding the missing values
> > differently, which is utterly odd. As those missing values
> > should not enter my likelihood function at all.
> ___________________________________________________________
> Yahoo! Exclusive Xmas Game, help Santa with his celebrity party -
> *
> *   For searches and help try:
> *
> *
> *

Lian Jian

*   For searches and help try:

© Copyright 1996–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index