[R-sig-ME] How to extract num. of observations and groups used in a mixed model using gee package

David Winsemius dwinsemius at comcast.net
Tue Apr 24 16:25:06 CEST 2012


On Apr 24, 2012, at 9:46 AM, Ben Bolker wrote:

> david oseguera montiel <oseguera.david at ...> writes:
>
>>
>> I meant the grouping factor in the model indicated by id. From gee
>> documentation 'id = a vector which identifies the clusters..'. So  
>> in the
>> warpbreaks data set, id = wool has 54 obs, in two clusters (groups).
>
> [snip]
>
>>>> David,
>>>> Thank you very much. Number of observations solved, but I am still
>>>> missing how to find out the number of groups used. In the  
>>>> warpbreaks
>>>> data set these are 2. Any ideas. Thank you.
>>>>
>>> I must be unclear what you mean by "number of groups".
>
>
> Didn't Chuck Cleland's answer work, i.e. length(unique(model 
> $id)) ... ?

It didn't work for me.
length(unique(summgee$id))
[1] 0
 > summgee$id
NULL

See my other reply for what did work. I suppose it could be that both  
the OP and I are behind on gee versions. Mine is 4.13-17 and I see  
that there is a more recent binary on CRAN. With a (slightly out-of- 
date)  version loaded, I am loath to detach because getting things to  
all sync up is a bit of a hassle and error-prone without a fresh start  
and I have other work time-consuming  running in this session.

-- 

David Winsemius, MD
West Hartford, CT



More information about the R-sig-mixed-models mailing list