predictFBLR: Predict Case Probabilities with Full Bayesian Logic...

Description Usage Arguments Value Author(s) See Also Examples

Description

Predicts case probabilities for binary data (usually SNP data dichotomized with snp2bin) based on an MCMC sample of Bayesian logic regression models obtained with fblr.

Usage

1
predictFBLR(file, bin, kmax = 10, int.level = 2)

Arguments

file

character string naming file where MCMC sample is stored.

bin

matrix of binary variables to make predictions for. One row is one observation. The number of binary variables has to be the same as used in fblr.

kmax

the maximum number of allowed logic predictors used in fblr.

int.level

the maximum number of allowed binaries in a logic predictor used in fblr.

Value

Vector of length nrow(bin) with predicted case probabilities.

Author(s)

Arno Fritsch, arno.fritsch@uni-dortmund.de

See Also

fblr

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
# Use fblr on some simulated SNP data
snp <- matrix(rbinom(500 * 20, 2, 0.3), ncol = 20)
bin <- snp2bin(snp)
int <- apply(bin,1,function(x) (x[1] == 1 & x[3] == 0)*1)
case.prob <- exp(-0.5+log(5)*int)/(1+exp(-0.5+log(5)*int))
y <- rbinom(nrow(snp),1,prob=case.prob)
fblr(y, bin, niter=1000, nburn=0)

# Prediction for some new observations 
newbin <- snp2bin(matrix(rbinom(100 * 20, 2, 0.3), ncol = 20))
predictFBLR("fblr_mcmc.txt",newbin)


## End(Not run)

scrime documentation built on May 2, 2019, 10:24 a.m.

Related to predictFBLR in scrime...