[R-sig-ME] glmer problems
Ben Bolker
bbolker at gmail.com
Thu Jun 2 15:23:38 CEST 2011
On 06/02/2011 09:07 AM, Dennis Murphy wrote:
> Hi:
>
> If the regions are intrinsically nested within country, then the
> second specification of your model is preferred. 'Intrinsic nesting'
> in this case means that the region names only occur in combination
> with exactly one country. If that is the case in your data, the second
> model specification should work.
>
> HTH,
> Dennis
Dennis is right about intrinsic vs explicit nesting. I think, though,
that normally lmer quietly handles the overparameterized form given in
your first specification. My guess would be that one or both of your
grouping variables are not factors, and that lmer is trying to evaluate
"cntry:region" in a context that tries to interpret ":" as a shortcut
for seq() rather than as a shortcut for interaction().
>
> On Thu, Jun 2, 2011 at 1:57 AM, Iasonas Lamprianou <lamprianou at yahoo.com> wrote:
>> Dear all. I am running this model but I get an error.
>>
>>> gmm1a <- glmer(workstatus ~ 1+(1|cntry) + (1|cntry:region),family=binomial,
>>> data=retirement2)
>> Warning in region:cntry :
>> numerical expression has 7011 elements: only the first used
>> Warning in region:cntry :
>> numerical expression has 7011 elements: only the first used
>> Warning in inherits(x, "factor") : NAs introduced by coercion
>> Error in region:cntry : NA/NaN argument
>>
>>
>>
>>
>> if I run a slightly different model, then it works
>>
>>> gmm1a <- glmer(workstatus ~ 1+(1|cntry) + (1|region),family=binomial,
>>> data=retirement2)
>>
>>
>> If I run the command below, it seems that there are no missing data either in
>> the cntry or in the region variables. Can anyone offer any hints please?
>>
>> sum(table(retirement2$region, retirement2$cntry))
>>
>>
>>
>> Dr. Iasonas Lamprianou
>> Department of Social and Political Sciences
>> University of Cyprus
>>
>>
>>
>>
>> ________________________________
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
More information about the R-sig-mixed-models
mailing list