[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: error in logistic regression when fitting models
At 07:47 PM 2/6/2005 -0500, Flaviaercole@aol.com wrote:
I am using logistic regression with Stata 8.1 to build models for
prediction of infection risk. Stata runs the full model. Then, by
removing variables (using p<0.2), I create new models, step by
step. However, at some moment, after to run the "lrtest" command (in
order to fitting both unconstrained and constrained models), Stata accuses
an error (number 498) informing that the two last models have different
observation numbers. What I have to do? In order to outline this trouble,
can you propose me some procedure? It follows a sequence of commands that
I am executing and the problem that occurs.
The Ns differ because your variables have differing amounts of missing
data; as you drop variables you regain cases. Specifically, asa has
missing cases. Since you start with the most complex model first, probably
the easiest thing to do is add
to the end of each logistic regression line after the first, e.g.
xi: logistic SSI i.contamin i.tipoproc i.hospital if e(sample)
Also check the -mark- and -markout- commands.
* For searches and help try: