Description Usage Arguments Value Author(s) See Also Examples
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
.
1 | predictFBLR(file, bin, kmax = 10, int.level = 2)
|
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 |
kmax |
the maximum number of allowed logic predictors used in |
int.level |
the maximum number of allowed binaries in a logic predictor
used in |
Vector of length nrow(bin)
with predicted case probabilities.
Arno Fritsch, arno.fritsch@uni-dortmund.de
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.