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: xtmelogit _3200 conformability error


From   rraciborski@stata.com (Rafal Raciborski, StataCorp)
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: xtmelogit _3200 conformability error
Date   Wed, 21 Mar 2012 11:11:09 -0500

Tara Roberts <tpearson@uoguelph.ca> reported a problem with the -xtmelogit-
command running on Stata 10.1:

> I am currently trying to run a random effects model looking at the prevalence
> of e. coli within flock by producer type and sample type, and clustering by
> producer ID as my upper level (more than 1 flock per producer was sampled)
> using the following command line in Stata 10.1;
> 
>  xi: xtmelogit ecoli i.prodcode i.sampcode || prodid:, or
> 
> I get the following error messages:
> 
> i.prodcode        _Iprodcode_1-3      (naturally coded; _Iprodcode_1 omitted)
> i.sampcode        _Isampcode_1-5      (naturally coded; _Isampcode_1 omitted)
>                        *:  3200  conformability error
>      _xtgm_estimate_re():     -  function returned error
>   _xtgm_estimate_re_st():     -  function returned error
>                  <istmt>:     -  function returned error

We were able to reproduce this error in Stata 10.1.  The error occurs when the
dependent variable is constant for some of the categories of the factor
variable in the fixed-effects equation.  This error does not occur under
Stata 11 or Stata 12 but the model would not converge because the problem is
ill conditioned.

The solution is to omit from the model categories for which the dependent
variable takes only one value.  Tara can generate the indicator variables by
hand and include in the model only those indicator variables for which the
dependent variable varies.  The code below illustrates this technique.

  // Setup
  . sysuse auto, clear
  . set seed 12345
  . gen u = uniform()>0.5

  // Identify zero cells
  . tabulate foreign rep78

  // Create indicators and fit a reduced model
  . qui tabulate rep78, gen(irep)
  . xtmelogit foreign irep3 irep4 irep5 || u:


-- Rafal                        -- Yulia
rraciborski@stata.com           ymarchenko@stata.com
*
*   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