TIMBR.consistent: Construct consistent prior from existing list-type prior.M

Description Usage Arguments Value Examples

View source: R/TIMBR_source.R

Description

Updates prior.M to be consistent with biallelic contrast encoded by M.ID

Usage

1
TIMBR.consistent(prior.M, M.ID)

Arguments

prior.M

prior.M object for use as TIMBR input, model.type must be list

M.ID

string that denotes the specified biallelic contrast

Value

updated prior.M object that is consistent with M.ID

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#example data
data(mcv.data)

#call TIMBR using CRP
results <- TIMBR(mcv.data$y, mcv.data$prior.D, mcv.data$prior.M$crp)

#approximate biallelic consistency BFs for all contrasts
head(TIMBR.approx(results))

#generate list object for CRP prior
prior.alpha <- list(type="gamma", shape=results$prior.M$prior.alpha.shape, rate=results$prior.M$prior.alpha.rate)
prior.M <- ewenss.calc(8, prior.alpha)

#specify biallelic contrast for consistency and update prior.M
M.ID <- "0,1,0,1,1,0,0,0"
prior.M <- TIMBR.consistent(prior.M, M.ID)

#analyze results, compare with approximate BF from earlier
results.consistent <- TIMBR(mcv.data$y, mcv.data$prior.D, prior.M)
results.consistent$ln.BF

wesleycrouse/TIMBR documentation built on Feb. 19, 2021, 7:31 a.m.