fitLogRegModel {PredictABEL} | R Documentation |
Function to fit a logistic regression model.
Description
The function fits a standard GLM function for the logistic regression model.
Usage
fitLogRegModel(data, cOutcome, cNonGenPreds, cNonGenPredsCat,
cGenPreds, cGenPredsCat)
Arguments
data |
Data frame or matrix that includes the outcome and predictor variables. |
cOutcome |
Column number of the outcome variable. |
cNonGenPreds |
Column numbers of the non-genetic predictors that are
included in the model. An example to denote column numbers is
|
cNonGenPredsCat |
Column numbers of the non-genetic predictors that
are entered as categorical variables in the model. When non-genetic
predictors are not specified as being categorical they are treated as
continuous variables in the model. If no non-genetic predictors are
categorical, denote |
cGenPreds |
Column numbers of the genetic predictors or genetic risk score.
Denote |
cGenPredsCat |
Column numbers of the genetic predictors that are entered as categorical variables in the model. When SNPs are considered as categorical, the model will estimate effects per genotype. Otherwise, SNPs are considered as continuous variables for which the model will estimate an allelic effect. Choose c(0) when no genetic predictors are considered as categorical or when genetic predictors are entered as a risk score into the model. |
Details
The function fits a standard GLM function for the logistic regression model.
This function can be used to construct a logistic regression model based on genetic and non-genetic
predictors. The function also allows to enter the genetic predictors
as a single risk score. For that purpose, the function requires that
the dataset additionally includes the risk score.
A new dataset can be constructed using
"NewExampleData <- cbind(ExampleData,riskScore)
".
The genetic risk scores can be obtained
using the function riskScore
in this package or be
imported from other methods.
Value
No value returned.
See Also
predRisk
, ORmultivariate
, riskScore
Examples
# specify dataset with outcome and predictor variables
data(ExampleData)
# specify column number of outcome variable
cOutcome <- 2
# specify column numbers of non-genetic predictors
cNonGenPred <- c(3:10)
# specify column numbers of non-genetic predictors that are categorical
cNonGenPredCat <- c(6:8)
# specify column numbers of genetic predictors
cGenPred <- c(11,13:16)
# specify column numbers of genetic predictors that are categorical
cGenPredCat <- c(0)
# fit logistic regression model
riskmodel <- fitLogRegModel(data=ExampleData, cOutcome=cOutcome,
cNonGenPreds=cNonGenPred, cNonGenPredsCat=cNonGenPredCat,
cGenPreds=cGenPred, cGenPredsCat=cGenPredCat)
# show summary details for the fitted risk model
summary(riskmodel)