[R-sig-ME] lmekin complains about dimnames

Joshua Wiley jwiley.psych at gmail.com
Fri May 18 15:27:49 CEST 2012


Hi David,

I did not understand what the ID was at first, but I see now.  I also
heard offlist from Terry Therneau that he is looking into why the
kinship matrix is lacking dimnames.

Thanks for your help!

Josh


On Thu, May 17, 2012 at 7:09 PM, David Duffy <David.Duffy at qimr.edu.au> wrote:
> On Thu, 17 May 2012, Joshua Wiley wrote:
>
>> require(kinship2)
>>
>> gadat <- with(adat, pedigree(PersonID, FatherID, MotherID, sex,
>
>               famid = FamilyID))
>>
>> kamat <- kinship(gadat)
>
>
>> (gfit1 <- lmekin(Outcome ~ factor(sex) + (1 | FamilyID), data=adat,
>> varlist=kamat))
>> # Error in bdsmatrix.reconcile(varlist, bname) :
>> #  No dimnames found on a variance matrix
>
>
> kamat is a kinship matrix, so you need (1|id) rather than FamilyID.  But
> aside from that, there seems to be a problem in the new kinship, as it
> only sets dimnames for the second dimension.  An ugly temporary solution is:
>
> dimnames(kamat)[[1]] <-  dimnames(kamat)[[2]]
>
> The second problem is that the individual IDs were non-unique. Since
> PersonIDs were non-unique, kinship generates a new ID, which is now needed
> to match up the correct kinship values
>
> adat$gid <- paste(adat$FamilyID,adat$PersonID,sep="/")
> lmekin(Outcome ~ factor(sex) + (1 | gid),
>       data=adat,varlist=list(gid=kamat))
>
>
> --
> | David Duffy (MBBS PhD)                                         ,-_|\
> | email: davidD at qimr.edu.au  ph: INT+61+7+3362-0217 fax: -0101  /     *
> | Epidemiology Unit, Queensland Institute of Medical Research   \_,-._/
> | 300 Herston Rd, Brisbane, Queensland 4029, Australia  GPG 4D0B994A v



-- 
Joshua Wiley
Ph.D. Student, Health Psychology
Programmer Analyst II, Statistical Consulting Group
University of California, Los Angeles
https://joshuawiley.com/



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