[R-sig-ME] lmekin complains about dimnames
David Duffy
David.Duffy at qimr.edu.au
Fri May 18 04:09:08 CEST 2012
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
More information about the R-sig-mixed-models
mailing list