Learn R Programming

a4 (version 1.20.0)

logReg: Logistic regression for predicting the probability to belong to a certain class in binary classification problems.

Description

Logistic regression for predicting the probability to belong to a certain class in binary classification problems.

Usage

logReg(object, groups, probesetId = NULL, geneSymbol = NULL, main = NULL, probe2gene = TRUE, ...)

Arguments

object
ExpressionSet object for the experiment
groups
String containing the name of the grouping variable. This should be a the name of a column in the pData of the expressionSet object.
probesetId
The probeset ID. These should be stored in the featureNames of the expressionSet object.
geneSymbol
The gene symbol. These should be stored in the column `Gene Symbol` in the featureData of the expressionSet object.
main
Main title on top of the graph
probe2gene
Boolean indicating whether the probeset should be translated to a gene symbol (used for the default title of the plot)
...
Possibility to add extra plot options. See par

Value

  • A data.frame object with three columns and rownames
  • rownamesThe 'sampleNames' of the expressionSet object
  • xThe expression values for the specified gene for all samples
  • yThe labels of the samples
  • fitThe fitted probability score to belong to one of the two classes.

Details

It will always estimate probability scores to belong to the second level of the factor variable. If a probability score to other level is preferred, then you need to change the order of the levels of the factor.

References

~put references to the literature/web site here ~

See Also

ROCcurve,probabilitiesPlot

Examples

Run this code
if (require(ALL)){
  data(ALL, package = "ALL")
  ALL <- addGeneInfo(ALL)
  ALL$BTtype <- as.factor(substr(ALL$BT,0,1))

  logRegRes <- logReg(geneSymbol = "HLA-DPB1", object = ALL, groups = "BTtype")

  # scoresplot
  probabilitiesPlot(proportions = logRegRes$fit, classVar = logRegRes$y,
      sampleNames = rownames(logRegRes), main = 'Probability of being a T-cell type ALL')
  # barplot
  probabilitiesPlot(proportions = logRegRes$fit, classVar = logRegRes$y, barPlot=TRUE,
      sampleNames = rownames(logRegRes), main = 'Probability of being a T-cell type ALL')
}

Run the code above in your browser using DataLab