Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: xtmelogit _3200 conformability error
From
[email protected] (Rafal Raciborski, StataCorp)
To
[email protected]
Subject
Re: st: xtmelogit _3200 conformability error
Date
Wed, 21 Mar 2012 11:11:09 -0500
Tara Roberts <[email protected]> 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
[email protected] [email protected]
*
* 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/