ped = data.frame(ID=1:4, FID=c(0,0,1,1), MID=c(0,0,2,2), SEX=c(1,2,1,1),
AFF=c(2,1,2,2), M_A1=c(1,1,1,1), M_A2=c(2,1,2,2))
x = linkdat(ped, model = 1)
# the likelihood at the disease locus:
likelihood(x, marker=NULL, t=0)
lod1 = likelihood(x, marker=1, t=0, logbase=10) -
likelihood(x, marker=1, t=0.5, logbase=10)
lod2 = lod(x, markers=1, t=0)
# should be the same:
stopifnot(identical(lod1, as.numeric(lod2)))
Run the code above in your browser using DataLab