Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: RE: 'Observations differ'


From   "Shittu, Aminu" <ameen_vet@yahoo.com>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: RE: 'Observations differ'
Date   Sun, 4 Dec 2011 18:04:04 -0800 (PST)

Hi Elan,

I learnt that I only can compare nested models and I need to have the same observations included.

I removed one var from the model, say var x3

Then the reduced command was: 

xi: logistic y x1 x2 if x3!=.

where != means not equal

Thank you.

Aminu. 



________________________________
From: "Cohen, Elan" <cohened@upmc.edu>
To: "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> 
Sent: Friday, December 2, 2011 3:07:45 PM
Subject: st: RE: 'Observations differ'

Aminu,

As many on this list will be quick to point out, it helps immensely if we can see the actual code you are typing.

However, my guess is that you are including a variable with some missingness causing the number of observations to be reduced in your bigger model (i.e. the one with more parameters).  One approach is to run your bigger model first then run the smaller model only using the observations included in the bigger model.  Something like:

xtmelogit x1-x10
g byte esample = e(sample)
xtmelogit x1-x9 if esample

HTH,

- Elan


--
Elan D Cohen, MS
Center for Research on Health Care Data Center
University of Pittsburgh 
cohened@upmc.edu



-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Shittu, Aminu
Sent: Friday, December 02, 2011 9:25
To: statalist@hsphsun2.harvard.edu
Subject: st: 'Observations differ'

To clarify on the message below. I am trying to develop a random effect logistic regression model.

A




----- Forwarded Message -----
From: "Shittu, Aminu" <ameen_vet@yahoo.com>
To: "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Cc: 
Sent: Friday, December 2, 2011 2:07:19 PM
Subject: 'Observations differ'

Dear Statalisters,

I am trying to do the LRT to compare full and reduced models but I am having problem with the "observations differ: 770 vs. 825" output. The first two LRTs worked well. How can I handle this, please?

Kind regards,


Aminu.


*
*   For searches and help try:
*  http://www.stata.com/help.cgi?searchhttp://www.stata.com/support/statalist/faqhttp://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*  http://www.stata.com/help.cgi?searchhttp://www.stata.com/support/statalist/faqhttp://www.ats.ucla.edu/stat/stata/ ;

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index