I have the following small data:
father <- c(NA, NA, NA, 1, 1, 1, 2, 2, 2, 3, 4)
mother <- c(NA, NA, NA, 2, 2, 1, 1, 1, 3, 4, 4)
idd <- c(1:11)
yvar <- rnorm(11, 5, 2)
xvar <- c(1,1,2, 1,2,1, 1,1, 2, 1,2)
mydf <- data.frame (father, mother, idd, yvar, xvar)
require(kinship)
kmat <- kinship(mydf$idd, mydf$father,mydf$mother)
1 2 3 4 5 6 7 8 9 10 11
1 0.500 0.000 0.00 0.250 0.250 0.500 0.250 0.250 0.0000 0.1250 0.250
2 0.000 0.500 0.00 0.250 0.250 0.000 0.250 0.250 0.2500 0.1250 0.250
3 0.000 0.000 0.50 0.000 0.000 0.000 0.000 0.000 0.2500 0.2500 0.000
4 0.250 0.250 0.00 0.500 0.250 0.250 0.250 0.250 0.1250 0.2500 0.500
5 0.250 0.250 0.00 0.250 0.500 0.250 0.250 0.250 0.1250 0.1250 0.250
6 0.500 0.000 0.00 0.250 0.250 0.750 0.250 0.250 0.0000 0.1250 0.250
7 0.250 0.250 0.00 0.250 0.250 0.250 0.500 0.250 0.1250 0.1250 0.250
8 0.250 0.250 0.00 0.250 0.250 0.250 0.250 0.500 0.1250 0.1250 0.250
9 0.000 0.250 0.25 0.125 0.125 0.000 0.125 0.125 0.5000 0.1875 0.125
10 0.125 0.125 0.25 0.250 0.125 0.125 0.125 0.125 0.1875 0.5000 0.250
11 0.250 0.250 0.00 0.500 0.250 0.250 0.250 0.250 0.1250 0.2500 0.750
This is example of inbred pedigree in plants where anything can be father or mother or vice versa. Even a single individual can be hermaphrodite (both mother and father) under-selfing. Even in this situation the relatedness between individual 1 with individual 1 should be 0.5. Is there any correct-way to correct this problem of kinship matrix estimation?
The mixed model fitting using lmekin function from kinship package is giving the following error:
require(kinship)
model1 <- lmekin(yvar ~ xvar , random = ~ 1|idd, varlist=list(kmat), data = mydf)
Warning message:
In coxme.varcheck(ncluster, varlist, n, gvars, groups, sparse, rescale, :
Diagonal of variance matrix is not constant