- 今日の前の記事でサイクルのない家系図をpivotで核家族に分解してみた
- ループ(近親婚)があるとどうなるかを見よう
p<-matrix(
c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
0, 0, 0, 0, 2, 2, 4, 4, 6, 6, 0, 0, 12, 13,
0, 0, 0, 0, 1, 1, 3, 3, 7, 7, 0, 0, 7, 10,
0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1,
1,1,1,1,3,1,1,1,1,2,1,1,2,1),
ncol=5)
MakePedigreeFromFamilyInfo<-function(p){
ns<-length(p[,1])
affected<-status<-rep(1,ns)
affected[which(p[,5]==2)]<-0
affected[which(p[,5]==3)]<-0
status[which(p[,5]==1)]<-0
status[which(p[,5]==2)]<-0
ptemp<-pedigree(id=p[,1],dadid=p[,3],momid=p[,2],sex=p[,4],affected=affected,status=status)
if(sum(ptemp$affected)==0)ptemp$affected<-affected
ptemp
}
plot(MakePedigreeFromFamilyInfo(p))
subnucs(p)
subnucs(p)
NULL
警告メッセージ:
In subnucs(p) : Loop detected, likelihood calculations will not work.